We recommend using the FTP client FileZilla. (You can also login using a program such as SecureCRT to log on remotely to eniac and transfer files via the command line.)
eniac-l.seas.upenn.edu
as the host (the letter L for linux, not the number 1).
Select SFTP using SSH2
as the servertype (which means "secure file transfer protocol" and "secure shell"). Choose Interactive
as the logon type and configure two-step verification. Type your eniac username in the user field.
Rename this site something useful like "eniac-l"Use one of the free, user-friendly SFTP (secure file transfer protocol) applications such as Fugu (or Cyberduck) which have a GUI (graphical user interface).
For Fugu:
.dmg
to mount the disk image, if your browser (we recommend Safari) doesn't automatically open safe downloads; then copy the Fugu application to your computer's Applications folder.First log on to eniac (directions can be found here). Then use scp (enter username/password for each copy command), sftp (enter username once and issue multiple transfer commands), or rsync.
Note: in the following examples, replace myname
with your eniac username.
Using scp
is easy. It has sytnax similar to that of the unix cp
command (cp from to
), along with additional user/host information. After entering an scp
command, you will be prompted to enter your password before the command is completed. For detailed info, see the scp
man page, available online or by typing "man scp
" at a shell prompt. The examples below are a short cheat sheet.
localfile
from the local current directory to the html
directory in your eniac account's home directory:
$ scp localfile myname@eniac-l.seas.upenn.edu:html/
remotefile
from the progs directory in your eniac account to your current directory on your computer. Note that the second argument is a dot "." which means current directory.
$ scp myname@eniac-l.seas.upenn.edu:progs/remotefile .
localfile
to the /usr/local/bin/
directory on eniac — assuming you have the required permissions. $ scp localfile myname@eniac-l.seas.upenn.edu:/usr/local/bin/
120/homework/
directory (and recursively all it contents) into the remote cse120
directory.
$ scp -r 120/homework/ myname@eniac-l.seas.upenn.edu:cse120/
$ tar -cvf myArchive.tar cse1xx/homework
$ gzip myArchive.tar // if gzip doesn't work, try zip. Still no luck? google and download gzip.
$ scp -r myArchive.tar.zip myname@eniac-l.seas.upenn.edu:cse1xx/
$ gunzip myArchive.tar.zip // or unzip
$ tar -xvf myArchive.tar
sftp username@eniac-l.seas.upenn.edu
where "username" is your username. Hit enter, and enter your password when prompted (nothing will appear on your screen as you type — as with most *nix password prompts, SFTP's doesn't echo).man sftp
). An example session follows.$ sftp mfickett@eniac-l.seas.upenn.edu
Connecting to eniac-l.seas.upenn.edu...
The authenticity of host 'eniac-l.seas.upenn.edu (158.130.69.89)' can't be established.
RSA key fingerprint is bf:b1:e4:01:4c:d3:69:e2:83:8b:8d:f9:b7:06:a3:a9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'eniac-l.seas.upenn.edu' (RSA) to the list of known hosts.
mfickett@eniac-l.seas.upenn.edu's password:
From the Unix command line, the sftp
command opens a connection; here, the username is mfickett
(use yours instaed), and the server is eniac-l.seas.upenn.edu
, which will be the same for you, connecting to Eniac.
sftp> ls
. .. .Favorites
.mozilla .muttrc .plan
.profile .project .ssh
Desktop Filezilla.htm Mail
Sites botworld2005Aug26.tar.gz date.sh
fluidballs.jar html mail
The ls
command lists the contents of the current directory (on the server). As with the normal command, it can be used as ls -l
to provide a more detailed listing, including ownership, permissions, and modification times.
sftp> lcd Desktop/
sftp> lls
speakerstmp.txt
The lcd
and lls
commands are like their usual counterparts — cd
for changing directory, ls
for listing — except that they act on the local side (your computer).
sftp> cd html
sftp> ls
. .. main.css
strstream.h useoldio.h
sftp> mget *.h
Fetching /mnt/castor/seas_home/m/mfickett/html/strstream.h to strstream.h
/mnt/castor/seas_home/m/mfickett/html/strstre 100% 3207 3.1KB/s 00:00
Fetching /mnt/castor/seas_home/m/mfickett/html/useoldio.h to useoldio.h
/mnt/castor/seas_home/m/mfickett/html/useoldi 100% 1036 1.0KB/s 00:00
The get
command gets a single file, whose name must be specified exactly; the mget
gets multiple files, and the filenames can be specified with wildcards; here, *
(star or asterisk) matches anything (so .h
and anything.h
will match. Any files matched on the remote side (the server) are copied to the local side, into the local working directory.
sftp> put speakerstmp.txt
Uploading speakerstmp.txt to /mnt/castor/seas_home/m/mfickett/html/speakerstmp.txt
speakerstmp.txt 100% 718 0.7KB/s 00:00
The put
and mput
commands work much like get
and mget
, except that they copy files from your computer (local) to the server (remote).
sftp> ls
. .. main.css
speakerstmp.txt strstream.h useoldio.h
sftp> rm speakerstmp.txt
Removing /mnt/castor/seas_home/m/mfickett/html/speakerstmp.txt
The rm
removes a file on the remote side.
sftp> ^D
To close the session, type control-d, or enter exit
or bye
.
Other useful commands include:
mkdir name
— make a new directory named name on the remote sidermdir name
— remve the directory named name on the remote side!command args
— execute the given command on the remote side with the given arguments. For example, !vi file.txt
will allow you to edit a file without closing your sftp session or opening a new local shellFor synchronizing directories (or larger groups of files), you may want to look up rsync. A typical execution I would use is this:
rsync -rlptv --delete ~/Documents/school/upenn/java120/ mfickett@eniac-l.seas.upenn.edu:/home1/m1/mfickett/cse120/
This would make my Eniac cse120/
directory look like the java120/
directory on my computer. The options used are as follows:
-r
— recursive; copy entire directories-l
— preserve links as links-p
— preserve permissions-t
— preserve modification times-v
— verbose; say what's going on--delete
— if a file exists locally (my computer) but not remotely (the server; Eniac), delete it from the server-n
— not used in this example, the -n
flag does a dry run: no files are modified, but all the information is printed out, so you can see if rsync
is doing what you want.As with most command-line usage, be careful; run rsync with the -n
and -v
flags the first time, especially if you're using --delete
. I recommend looking at the rsync examples section.