Linux under the SCP command usage method

Source: Internet
Author: User
Tags rsync scp command

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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.