The use 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 configure an FTP server or share, and does not have access to a file in a regular way, but only through simple SCP commands.
Copy a native file to a remote server
#scp/home/administrator/news.txt Root@192.168.6.129:/etc/squid
/home/administrator/the absolute path of the local file
News.txt local files to be copied to the server
Root is logged on to the remote server through the root user (or with other users with equal privileges)
192.168.6.129 the IP address of the remote server (you can also use the domain name or machine name)
/etc/squid Copy Local files to a path located on a remote server
Copy the files on the remote server to this computer
#scp Remote@www.abc.com:/usr/local/sin.sh/home/administrator
Remote users log on to a distant server (or use other users with equal privileges)
www.abc.com the domain name of the remote server (you can use the server IP address, of course)
/usr/local/sin.sh a file on a remote server that you want to copy to this computer
/home/administrator 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, specific port depending on the situation, the command format is as follows:
#scp-P 4588 remote@www.abc.com:/usr/local/sin.sh/home/administrator
2. Use the SCP to be aware of whether the user you are using has permission to read the appropriate files for the remote server.
Such as:
# Scp/var/log/sql-slow-queries.log Root@192.168.1.50:/root
Copy the local/var/log/sql-slow-queries.log this file to 1.50 above the/root directory