How to use sftp command under Linux

  
 

sftp is an interactive file transfer program. It is similar to ftp, but it performs encrypted transmission and is more secure than FTP. Here is a brief introduction to how to remotely connect to the host, upload and download files, and some related operations. For example, if the IP of the remote host is 202.206.64.33 or the domain name www.zhixing123.cn, the username is fyt, in the command line mode: sftp [email protected] or [email protected]. Enter to prompt for a password. Enter the prompt sftp> If you log in to the remote machine not to upload the downloaded file, but to modify some files on the remote host. Can ssh [email protected] (In fact, sftp is a program of ssh.) sftp> get /var/www/fuyatao/index.php /home/fuyatao/This statement will be from the remote host /var/www/fuyatao/Download index.php to the local /home/fuyatao/directory. Sftp> put /home/fuyatao/downloads/Linuxgl.pdf /var/www/fuyatao/This statement will upload the linuxgl.pdf file in the local /home/fuyatao/downloads/directory to the remote host /var/www/fuyatao /Under contents. If you don't know what the remote host's directory looks like, the pwd command can help you query the current path of the remote host. Query the current working directory of the machine lpwd. Change the path to use cd, change the local path can use lcd; ls rm rmdir mkdir These commands can be used. The same call to the machine is to add l, that is, lls lrm. To leave sftp, use exit or quit, bye. For details, see man sftp. If you find it inconvenient in command line mode, you can sudo apt-get install gftp. It is much easier to operate under the graphical interface.

Copyright © Windows knowledge All Rights Reserved