Department of Mathematics FAS Harvard University One Oxford Street Cambridge MA 02138 USA Tel: (617) 495-2171 Fax: (617) 495-5132
FAS Computer Services to Harvard University IT: (617) 495-7777.
This page contains some information to securely upload files to an other machine. The tools are called "sftp" which stands for "secure file transfer protocol" as well as "scp"="secure copy".

sftp (Solaris, Linux, OS X)

Example: To transfer a file "test.html" to the folder public_html on the math1c account at fas, type

sftp math1c.hogwards.edu
Connecting to fas.hogwards.edu...
math1c.hogwards.edu's password:********
sftp>cd public_html
sftp>put test.html
sftp>exit 


scp (Solaris, Linux, OSX)

The same file transfer can be performed better with

scp test.html math1c.hogwards.edu:public_html
math21b.hogwards.edu's password: ********


Authomatic Login

If you don't want to type the password every time or you need to upload files using a script, it can be helpful to allow authomatic access to the account. To do so, follow the following steps.

ssh-keygen -t rsa


Just type return, when asked for the file to save the key. When the keygeneration program askes you for a passphrase, leave an empty passphrase, twice. Now transfer this file to the account to which you want to have automatic access:

scp .ssh/id_sra.pub math1c.hogwards.edu:


Now log into that account using ssh and type

mkdir .ssh
cat id_sra.pub >> .ssh/authorized_keys2


You should now be able to access the account math1c.hogwards.edu without typing the password.


Caution

It pays off to be careful with file transfers. It is easy to lose data, when shifting it from one computer to an other. Just two common pitfalls:
  • You worked on a file on your local computer. Now its time to upload. Already tired, you download the old file instead of to upload the new file. Your work is gone.
  • You work on a file "index.html" for your website. When uploading the file, you accidently land in a different folder, where an other file "index.html" resides.


Macintosh

The ftp program on an Macintosh with OS 9.* is called "Fetch". If you upload text files like PS or TeX files, upload the files in Text mode. For binaries, like GIF,JPG you have to upload files in the format "Raw Data". In OS X, it is best to upload things from the command line.

PC

SecureFX There are several options for PC's. One possibility is "SecureFX". These GUI programs are rather self explanatory.


Simplicity, Clarity, Generality B.W. Kernighan, R. Pike, in "The Practice of Programming".
Privacy
HTML CSS