Use ssh to transfer files

Source: Internet
Author: User
Tags scp command

In linux, the scp command is generally used to transmit files through ssh. 1. download the file scp username @ servername:/path/filename such as scp root@192.168.0.101 from the server: /var/www/test.txt download the/var/www/test.txt file on 192.168.0.101 to the current directory 2. Upload the local file to the server scp/path/filename username @ servername: /path, for example, scp/var/www/test. php root@192.168.0.101:/var/www/put the local/var/www/directory test. upload the PHP file to the/var/www/directory on the server 192.168.0.101. 3. Download the entire scp-r username @ servername:/var/www/local_dir/from the server. For example: scp-r root@192.168.0.101:/va R/www/test/var/www/4. Upload the directory to the server scp-r local_dir username @ servername: remote_dir For example: scp-r test root@192.168.0.101: /var/www/upload the test directory under the current directory to the/var/www/directory on the server. Note: The write permission must be enabled for the target server. Scp packages must be installed on both servers.

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.