SCP copy and rename all files in the Copy folder and folder
The Copy folder (including the folder itself)
Scp-r/home/wwwroot/www/charts/util [Email PROTECTED]:/HOME/WWWROOT/LIMESURVEY_BACK/SCP
All files under the Copy folder (not including the folder itself)
scp/home/wwwroot/www/charts/util/* [Email PROTECTED]:/HOME/WWWROOT/LIMESURVEY_BACK/SCP
Rename the Copy file
scp/home/wwwroot/www/charts/util/a.txt [Email Protected]:/home/wwwroot/limesurvey_back/scp/b.text
Usage of SCP under Linux
The SCP is secure copy, a command that is used to remotely copy files under Linux.
Sometimes we need to get a file on a remote server that does not have an FTP server configured, or shared, and cannot get the files by conventional means, but only needs to be achieved with simple SCP commands.
First, copy the native files to the remote server
#scp/home/administrator/news.txt [Email protected]:/etc/squid
/home/administrator/absolute path to local files
News.txt The local file to be copied to the server
Root logs on to the remote server through the root user (you can also use other users with equal privileges)
192.168.6.129 the IP address of the remote server (you can also use a domain name or machine name)
/etc/squid copying local files to a path located on a remote server
Log in to the remote server by root and enter Yes to agree to an SSH connection
Enter the root user's password as prompted
Start transferring files after establishing a connection, showing percentages, actual time, and delivery speed information
Second, copy the files on the remote server to the native
#scp [Email Protected]:/usr/local/sin.sh/home/administrator
Remote logs on to the server remotely via a long-distance user (other users with equivalent privileges can also be used)
www.abc.com the domain name of the remote server (you can also use the server IP address)
/usr/local/sin.sh files that are located on a remote server to be copied to this computer
/home/administrator to copy remote files to the local absolute path
Note two points:
1. If the remote server firewall has special restrictions, the SCP will go to the special port, depending on what port, depending on the situation, the command format is as follows:
#scp-P 4588 [email Protected]:/usr/local/sin.sh/home/administrator
2. Use SCP be aware that the user you are using has permission to read the appropriate files for the remote server.
Usage of SCP under Linux