Copy the file to another server using the Linux SCP command

Source: Internet
Author: User

For example, I want to copy the files in 59.64.30.101 TO THE 59.64.28.78 server. The procedure is as follows:

Run the following command on the 1.59.64.30.101 terminal:

# Ssh-keygen-T RSA

2. After the key is generated, two files, id_rsa id_rsa.pub, will be generated in the/root/. Ssh/folder.

Copy the id_rsa.pub file to 59.64.28.78

Run the following command:

SCP id_rsa.pub root@59.64.28.78:/root/. Ssh/authorized_keys

3. if you copy a file from 59.64.30.101 to the 59.64.28.78 server, you do not need to enter a password.

 

SCP command application:

Copy a file:
(1) Copy local files to remote
SCP file name root@59.64.28.78: remote path
(2) remotely copy the file back to local
SCP root@59.64.28.78: local path of file name
Copy directory:
(1) copy the local directory to a remote
SCP-r directory name root@59.64.28.78: remote path
(2) remotely copy the directory back to local
SCP-r root@59.64.28.78: directory name local path.

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.