[Linux] scp command remote replication
In the past few days, the scp command has been used to build the environment for systems that have not been used before, so we can query how to use the information.
Scp is short for secure copy. It is mainly used for remote copying of files and directories between linux systems.
You can easily copy files and directories from another server. Generally, the remote server does not enable ftp, file sharing, or web file services.
Prerequisites:
1. You must have the permission to operate the remote system.
2. The port used for the channel is not restricted by the firewall. Of course, you can select this port. The default port is 22.
Basic Format
Scp [optional parameter] file_source file_target
-P specified port: # scp-p 4588 remote@www.abc.com:/usr/local/sin. sh/home/administrator
-R recursive copy Directory: scp-r www.cumt.edu.cn:/home/root/others/home/space/music/
-V shows the execution process
Copy from local to remote:
Scp local_file remote_username @ remote_ip: remote_folder_file
Scp local_file remote_ip: remote_folder
If a user name is specified, you only need to enter the password. If no user name is written, you need to enter the user name and password.
[root@n234 ~]# scp ./install.log root@192.168.30.237:/tmp/root@192.168.30.237's password:install.log
./Install. og local file path
Root remote system user
Ip address of the remote system 192.168.30.237
/Tmp/directory for remote file storage
Copy from remote to local:
Scp remote_username @ remote_ip: remote_file local_file
[root@n234 ~]# scp root@192.168.30.237:/tmp/install.log /tmp/root@192.168.30.237's password:install.log 100% 35KB 35.0KB/s 00:00
Root remote system username
Ip address of the remote system 192.168.30.237
/Tmp/install. log Remote System File Path
/Tmp/folder for local file storage
This article is from the "orangleliu notebook" blog, please be sure to keep this http://blog.csdn.net/orangleliu/article/details/38399493