Secure File Transfer


You can start sftp in much the same way you start ssh, e.g. ‘sftp username@remotehost’. Once you are connected, the environment functions like traditional ftp:

$ sftp
sftp> cd /tmp
sftp> put Book1.gnumeric
Uploading Book1.gnumeric to /tmp/Book1.gnumeric
sftp> get asdf
Fetching /tmp/asdf to asdf
sftp> quit



SCP is useful for non-interactive file copying. The following will copy file into the user’s home direcory on the remote side:

$ scp file's password: 
file                100% |*****************************|   595       00:00


The following will copy the remote directory dir/ to the local directory dir2/ via the ‘-r’ (recursive) command-line switch:

$ scp -r dir2/'s password: 
$ ls dir2/