SSH provides instructions and shell for logging on to the remote server. By default, it does not allow you to copy files, but still provides a "SCP" command.
Suppose you want to copy a file named "dumb" in the current directory of the Local Computer to your home directory on the remote server www.foobar.com. The name of your account on the remote server is Bilbo ". You can use this command:
SCP dumb bilbo@www.foobar.com :.
Copy the file back and use this command:
SCP bilbo@www.foobar.com: Dumb.
"SCP" calls SSH to log on, copy the file, and call SSH to close the connection.
If your "~ The/. Ssh/config file has already configured www.foobar.com as follows:
Host * FBC
Hostname www.foobar.com
User Bilbo
Forwardagent Yes
Then you can replace "bilbo@www.foobar.com" with "FBC", and the command is simplified to "SCP dumb FBC :.".
"SCP" assumes that your home directory on the remote host is your working directory. If you use a relative directory, it is relative to the home directory.
The "-R" parameter of the "SCP" command allows recursive directory copying. "SCP" can also copy files between two different remote hosts.
For more information about SSH, see the http://www.linuxaid.com.cn/engineer/brimmer/html/ssh.htm
SCP user @ host:/path/to/Files local_file_name
Copy to remote
SCP local_file_name user @ host:/path/to/Files
Copy directory to remote
SCP-r local_file_name user @ host:/path/to/Files
FTP:
Wget ftp://ftp.isc.org/isc/bind9/9.2.2/bind-9.2.2.tar.gz
Http://blog.chinaunix.net/u/8983/showart.php? Id = 55609
Http://www.unix206.com/8/166189.html
SCP command
The SCP command is the most convenient and useful command in SSH. Just use the SCP command to directly transfer files between two servers. You can run it as root on a server # SCP servername:/home/FTP/pub/file1. in this way, the file/home/FTP/pub/file1 on the other server is directly transferred to the current directory of the machine. Of course, you can also use # SCP/tmp/file2 servername: /boot sends/tmp/file2 files on the local machine to the/boot directory of another machine. The entire transfer process is still encrypted using SSH.