sftp is a command in the Linux system. The number of users is not much, so many users do not know the purpose of the sftp command. The sftp command can be used to transfer files, which is similar to ftp. The following small series will introduce you to the way Linux uses the sftp command to transfer files.
1. landing approach used:
Format: sftp "user" @ "host"
is connected via sftp "host", the default port 22, Specify the user "user".
2. View sftp support commands
Use the help command to view supported commands, such as:
sftp"help
(where the command is “l” indicates local execution, others indicate execution on the remote host that is logged in.)
3.Basic use
sftp is mainly used to transfer files, including uploading files (from This machine goes to the remote host) and downloads the file (from the remote host to the local machine).
(1) File Download
get [-Ppr] remote [local]
For example: get test.cpp. /Project/
Download the file test.cpp from the remote current directory to the Project folder in the local current directory.
(2) File upload
put [-Ppr] local [remote]
For example: put /home/liu/Software/RHEL_5.5\\ x86_64.iso /Home/xudong/Blog/
Transfer the ios file from the local /home/liu/Software/directory to the /home/xudong/Blog/directory of the remote login host.
(3) Other commands
There are several commands that can be used, such as ls, lls; cd, lcd; pwd, lpwd, etc. See the help output for details.
sftp is the secure file transfer program, which is based on ssh and is very convenient for transferring documents between two Linux systems.
To use sftp to pass documents, you should first open the ssh service on the server side. If it is not open, you can usually open it with the following command:
# /etc/init.d/sshd start< Br>
Then you can log in to the server through the sftp client for document delivery, as follows:
$ sftp [-oPort=port_number] username@server_ip[:file1 file2 . . . ]
Parameter Description:
-o is used to pass parameters to ssh, such as -oPort=222, which tells ssh to use port 222 of the connection server instead of the default port 22. This can be useful when you encounter a change in the default port 22 of the ssh service on the server side.
The following file1, file2 represents the file name, and can also be a directory. When no file is specified, an interactive interface is opened, and the document can be passed by command under the interactive interface.
For example:
$ sftp -o port = 222 [email protected]
Command Description:
Under the interface of the sftp command There are many commands that can be used, such as: cd, ls, pwd, bye, chmod, chgrp, chown, df, get, help, mkdir, and so on. Of course, these commands are all for server-side operations, some of which can be implemented locally under the prefix of l. For example, the lpwd command prints the local current working directory (that is, the current working directory before connecting sftp). Two of these commands are used to exchange documents. They are get and put commands, as follows:
” put local_path [remote_path]
” get remote_path [lcoal_path]
The put command will push the local file or directory to the server; the get command will pull the server-side file or directory "draw".
The above is the introduction of Linux using the sftp command to transfer files. Compared with ftp, the sftp command is more secure. It is recommended to use the sftp command to transfer files.
Cacti is a network traffic monitoring graphical analysis tool, which needs to be im
Among the many commands in Linux, the netstat command is a console command for moni
The compatibility between Linux and iPhone is not good. I want to mount the iPhone
After many friends have contacted the CentOS system, they found that the fonts that
Linux how to use the Xsnow command to display the snow effect on the desktop
How to view the vsftp database db file in Linux
How does Ubuntu automatically switch between the mouse and the shared clipboard under VirtualBox?
Linux vim shows utf-8 document garbled how to do?
How to solve the garbled problem after SecureCRT connects to Linux server
CentOS version information viewing tips
Linux no network installation GCC skills
How to use uniq command to delete text duplicate lines in Linux system
How to display the number of Linux subfolders and files
Computer black screen check ideas to help you solve the black screen failure
Vista installation detailed process (illustration)
How does Win7 open the process manager? Win7 open task manager method
For Win10 (Mobile), Microsoft shows high-profile love to Apple and iOS developers
Win7 system can not be reinstalled after uninstalling CAD.
Win7 sound suddenly big and small how to do
XP Practical Tips: Get Permissions
Fun Win7 window smart arrangement feature
Win7 system files are isolated by 360 antivirus security guards how to recover?