Linux's SCP commands allow you to copy files and directories between Linux;
==================
SCP command
==================
The SCP can replicate files between 2 Linux hosts;
Command basic format:
SCP [Optional parameters] File_source File_target
SCP command: File replication between two servers
The code is as follows |
Copy Code |
scp/home/space/1.html Root@ip Address:/home/root/others/#这里复制本地/home/space/1.html to the/home/root/others of the remote address, the system prompts you after the carriage return [Root@localhost data]# scp-r/data/rsynctest/root@192.168.42.128:/data/rsync The authenticity of host ' 192.168.42.128 (192.168.42.128) ' can ' t be established. RSA key fingerprint is 6d:cd:c9:6c:8d:40:aa:1c:0d:db:62:9f:63:4c:3c:b1. Are you sure your want to continue connecting (yes/no)? Yes #这里直接输入yes, then come down and enter the remote user's password to copy [Root@localhost data]# scp-r/data/rsynctest/root@192.168.42.128:/data/rsync The authenticity of host ' 192.168.42.128 (192.168.42.128) ' can ' t be established. RSA key fingerprint is 6d:cd:c9:8c:9d:40:aa:1c:0d:db:62:9f:63:4c:3c:b1. Are you sure your want to continue connecting (yes/no)? Yes 1 100% 0.0kb/s 00:00 1.jpg 100% 0 0.0kb/s 00:00 test.html 100% 0.0kb/s 00:00 |
Replicate from local to remote
======
* Copy files:
* Command format:
The code is as follows |
Copy Code |
SCP Local_file Remote_username@remote_ip:remote_folder Or SCP Local_file Remote_username@remote_ip:remote_file Or SCP Local_file Remote_ip:remote_folder Or SCP Local_file Remote_ip:remote_file
|
1th, 2 specified the user name, the command needs to enter the password after the execution, the 1th specified only the remote directory, the file name unchanged, the 2nd specified the filename;