Useful SCP & RCP

Source: Internet
Author: User
Tags scp command secure copy
Use SCP & RCP-general Linux technology-Linux technology and application information. For more information, see the following. Linux File Transfer command
SCP (Secure Copy)
The scp command is the most convenient and useful command in SSH. Just use the scp command to directly transfer files between two servers. You can
Run as root # scp servername:/home/ftp/pub/file1. /In this way, the file/home/ftp/pub/file1 on the other server is directly transferred to the current directory of the machine. Of course, you can also use # scp/tmp/file2 servername: /boot sends/tmp/file2 files on the local machine to the/boot directory of another machine. The entire transfer process is still encrypted using SSH.
Scp is secure copy, which is used to copy remote files. Data transmission uses ssh and uses the same authentication method as ssh to provide the same security guarantee. Unlike rcp, scp requires you to enter a password or password for verification.
Simplest application example
The simplest application is as follows:
Scp Local User Name @ IP Address: file name 1 remote user name @ IP Address: file name 2
[Local username @ IP Address:] You may not need to enter the password corresponding to the remote username.
Several useful parameters:
-V is the same as-v in most linux commands. It is used to display the progress. It can be used to view the connection, authentication, or configuration error.
-C enable compression options.
-P: select the port. Note that-p has been used by rcp.
-4 Use the IPV4 address forcibly.
-6 Use IPV6 addresses forcibly.
-R Recursively copy entire directories.
For example --
Copy local files to a remote machine
Scp/etc/lilo. conf my@www.upsdn.net:/home/my
Copy the local/etc/lilo. conf file to www.upsdn.net.
========================================================== ==================
For example:
Copy local files to a remote machine
Scp/etc/lilo. conf k@net67.ee.oit.edu.tw:/home/k
Copy the local/etc/lilo. conf file to the net67.ee.oit.edu.tw directory of user k.
Copy the files on the remote machine to the local device
Scp k@net67.ee.oit.edu.tw:/etc/lilo. conf/etc
Copy the/etc/lilo. conf file in net67.ee.oitdu.tw to the local/etc directory.
Keep the attribute of the source host file
Scp? P k@net67.ee.tw:/etc/lilo. conf/etc
Note whether the user's permissions can read files remotely.
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.