Use SCP command for server file mutual transfer in Linux

Source: Internet
Author: User
Tags ssh scp command


WordPress University in the last few days the server environment is not very stable, CPU occupancy is always 100%, toss several times did not find the reason, had to consider the reconfiguration of the environment, considering the configuration and optimize the environment need a few hours, the total can not stop the site, so will be the University of WordPress The website temporarily migrates to another server to run, the configuration is good to move back again.

It seems that the next Aliyun two cloud servers, are the same area, so decided to file transmission through the intranet, speed does not say (normal transmission file speed can reach 35m~50m/s), also do not occupy the public network bandwidth.

Ali so the server has a security Group Policy, you may need to set the intranet into, out of the direction of the IP White list:

0122-cmhello_com

If your cloud server does not have the above security policy, you can ignore it.

The next step is to use the SCP Remote Transfer command, which, as long as it is a Linux system, is logged in to the SSH client (such as Putty).

1, get the files on the remote server

Scp-p 2223 root@10.23.185.16:/root/test.tar.gz/home/test.tar.gz

The uppercase P in the command is the port parameter, 2223 is the port of SSH, and if it is 22, you may not need this parameter, if it is a different port, you must fill it out.
Root@10.23.185.16 means to log on to a remote server using root user 10.23.185.16
:/root/test.tar.gz represents the files and paths on the remote server

The/home/test.tar.gz on the last side represents the path and file name saved locally.
After executing the command, the normal word will have a question, enter Yes return, and then need to enter the remote server's root password, can return.

2, get the directory on the remote server

Scp-p 2223-r root@10.23.185.16:/root/dirname//home/dirname/

Note: If it is a directory, you need to add a-R parameter

3, upload the local files to the server

Scp-p 2223/home/test.tar.gz root@10.23.185.16:/root/test.tar.gz

4, upload the local directory to the server

Scp-p 2223-r/home/dirname/root@10.23.185.16:/root/dirname/

Use SCP for intranet transmission, the speed is sure lever!

Related Article

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.