Under Linux general use SCP This command to transfer files via SSH.
First, what is SCP?
The SCP is a shorthand for secure copy, a command for remotely copying files under Linux, and a similar command with CP, although the CP is only copied natively and cannot cross the server, and the SCP transfer is encrypted. may have a slight effect on the speed.
Ii. What is the use of SCP?
1, we need to obtain a file on the remote server, the remote server does not configure the FTP server, does not open the Web server, and does not share, unable to obtain the file through the regular way, only through the SCP command can easily achieve the purpose.
2, we need to upload the file on the computer to the remote server, the remote server does not open the FTP server or share, can not be uploaded through the conventional way is, only through the SCP command to easily achieve the purpose.
Iii. methods of use of the SCP
1. Downloading files from the server
SCP [Email protected]:/path/filename/var/www/local_dir (Local directory)
For example SCP [email protected]:/var/www/test.txt to download/var/www/test.txt files on 192.168.0.101 to/var/www/local_dir (local directory)
2. Uploading local files to the server
scp/path/filename [Email Protected]:/path
For example scp/var/www/test.php [email protected]:/var/www/the test.php file in the native/var/www/directory to 192.168.0.101 directory on this server
3. Download the entire directory from the server
scp-r [Email protected]:/var/www/remote_dir/(remote directory)/var/www/local_dir (local directory)
Example: scp-r [email protected]:/var/www/test/var/www/
4. Upload directory to server
Scp-r Local_dir [Email protected]:remote_dir
For example: scp-r test [email protected]:/var/www/upload the test directory under the current directory to the/var/www/directory of the server
Note: You need to enable permissions on the WWW directory chmod 777 www
Using SSH remote file Transfer command SCP under Linux