Linux SCP remote copy files and folders

Source: Internet
Author: User

Http://www.jb51.net/LINUXjishu/73131.html

Http://blog.chinaunix.net/uid-20754793-id-177618.html



Linux SCP remote copy files and folders, the need for friends can refer to the following

1, copy native/home/administrator/test entire directory to the remote host 192.168.1.100/root directory


Copy Code

The code is as follows:


Scp-r/home/administrator/test/[Email protected]:/root/

2. Copying a single file to a remote host


Copy Code http://www.jb51.net/LINUXjishu/73131.html

The code is as follows:


scp/home/administrator/desktop/old/driver/test/test.txt [Email protected]:/root/

In fact, the upload file and folder differences in the Parameters-R, with the CP, RM parameters use almost, text markup multiple-R

3. remote File/Folder download

For example, download the/root/folder above the 192.168.62.10 to the local/home/administrator/desktop/new/and use the remote root login


Copy Code

The code is as follows:


scp-r [Email protected]:/root//home/administrator/desktop/new/




 
copy files on a remote machine using SCP
For example:
Copy Local files to a remote machine
scp/etc/lilo.conf [Email protected]:/home/k
The local/etc/lilo.conf file will be copied to net67.ee.oit.edu.tw, user K's home directory.

Copy the files on the remote machine to local
SCP [Email protected]:/etc/lilo.conf/etc
Copy the/etc/lilo.conf file from the net67.ee.oitdu.tw to the local/etc directory.
keep the properties from the source host archive
scp–p [Email protected]:/etc/lilo.conf/etc


It is important to note that the user's permissions can be read remotely on the file, if you want to know more about the use of SCP, you can look at the SCP manual.
Ssh-keygen
generate a public key (Pulib key) and private key to guarantee the security of SSH online, when SSH connects SHD server, will exchange the public key, the system will check the key stored in/etc/ssh_know_hosts, if the client is found Use this key to generate a randomly generated session key to the server, both ends use this key to continue to complete the rest of the SSH phase.

it generates identity.pub, identity two files, the private key is stored in the identity, the public key is stored in identity.pub, and the next use of SCP will identity.pub copy To the home directory of the remote machine. Authorized_keys. Ssh/authorized_keys under SSH (this Authorized_keys file is equivalent to the rhosts file of the agreement), after which the user can log in without a password. RSA certification is definitely more secure and reliable than rhosts certification.
Execution:
SCP identity.pub [email Protected]:.ssh/authorized_keys

scp-r [email Protected]:~/linshi./cao


Linux SCP remote copy files and folders

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.