From http://www.cnblogs.com/chen1987lei/archive/2010/11/26/1888391.html
SFTP is an interactive file transfer program. It is similar to FTP, but it is encrypted and has higher security than FTP. Below is a brief introduction of how to connect the host remotely, file upload and download, and some related operations.
For example, if the remote host IP is 202.206.64.33 or domain name www.hebust.edu.cn, the user name is Fyt, in the command line mode: SFTP [email protected] or [email protected]. Enter prompt for password. Enter the prompt
Sftp>
If you log on to the remote machine not to upload the download file, but to modify some files on the remote host. OK
SSH [email protected] (in fact, SFTP is an SSH program.) )
If you want to log in through a key file, you can:
Sftp-i/home/downloads/1.key [email protected] if prompted
Permissions 0640 for '/home/downloads/1.key ' is too open.
It is required this your private key files are not accessible by others.
This private key would be ignored.
You need to give 600 permissions chmod 600/home/downloads/1.key
Sftp> get/var/www/index.php/home/
This statement will download the index.php to the local/home/directory from the/var/www//directory of the remote host.
Sftp> put/home/downloads/linuxgl.pdf/var/www/
This statement uploads the Linuxgl.pdf file under the local/home/downloads/directory to the remote host/var/www/directory. Note that the absolute path is used here.
If you do not know what the remote host directory is, the PWD command can help you query the current path of the remote host. Query native current working directory lpwd.
Change the path can be used CD, change the local path can be used LCD;
LS RM rmdir mkdir These commands are available. The same call native is add L, that is, Lls LRM.
To leave SFTP, use Exit or quit, bye. The man sftp can be consulted in detail.
If you find it inconvenient in command line mode, sudo apt-get install gftp. It's much easier to operate in a graphical interface.
Use of SFTP in Linux (RPM)