Scp commands in linux

Source: Internet
Author: User
Scp commands in linux: files can be copied between two linux hosts. the command format is SCP [optional parameter] file_sourcefile_targetwww.2cto.com1. copy files from local to remote: * command format :...
Scp commands in linux: files can be copied between two linux hosts. the command format is SCP [optional parameter] file_source file_target www.2cto.com 1. copy files from local to remote: * command format: scp local_file remote_username @ remote_ip: remote_folder or scp local_file remote_username @ remote_ip: The username is specified for the first and second remote_file. after the command is executed, enter the password again, only the remote directory is specified for the 1st files, and the file name is unchanged for the 2nd files; www.2cto.com * copy Directory: * command format: scp-r local_folder remote_username @ remote_ip: remote_folder or scp-r local_fol Der remote_ip: remote_folder 1st specifies the user name. after the command is executed, enter the password. if the user name is not specified, enter the user name and password. * For example: scp-r/home/space/music/root@www.cumt.edu.cn:/home/root/others/scp-r/home/space/music/www.cumt.edu.cn: /home/root/others/the above command copies the local music directory to the remote others directory, that is, there is a remote copy .. /others/music/directory www.2cto.com 2. copy from remote to local, as long as the last two parameters copy from local to remote command to change order; for example: scp root@www.cumt.edu.cn: /home/root/o Thers/music/home/space/music/1.mp3 scp-r www.cumt.edu.cn:/home/root/others/home/space/music/The simplest application is as follows: scp local user name @ IP address: file name 1 remote user name @ IP address: file name 2 [local user name @ IP address:] can be left blank. you may need to enter the password corresponding to the remote user name. possible useful parameters:-v is the same as-v in most linux commands to display the progress. it can be used to view connections, authentication, or configuration errors. www.2cto.com-C enable compression option. -P: Select the port. note:-p has been used by rcp. -4 use the IPV4 address forcibly. -6 use IPV6 addresses forcibly. note: 1. if the remote server firewall has special restrictions, scp must use special ports, The specific port depends on the situation, the command format is as follows: # scp-p 4588 remote@www.abc.com:/usr/local/sin. sh/home/administrator 2. when using scp, pay attention to whether the user has the permission to read the corresponding files on the remote server.
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.