SCP application in Linux

Source: Internet
Author: User
Tags scp command 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. Application Instance 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. -C enable compression options. -P: select the port. note:-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 will replace the local/etc/Lilo. the conf file is copied to the user's home directory. For example, copy the local file to a remote machine. SCP/etc/Lilo. conf will copy the local file/etc/Lilo. conf to the Home Directory of net67 user k. Copy the files on the remote machine to the Local. SCP. ETC/Lilo. CONF/etc will copy the/etc/Lilo. conf file to the local/etc directory. Keep the attribute SCP-p k @ net67.:/etc/lilo from the source host file. conf/etc must pay attention to whether the user's permissions can read files remotely. If you want to know more about SCP usage, you can refer to the SCP user manual. Ssh-keygen generates a Public Key (pulib key) and a private key (Private Key) to ensure the security of SSH. When SSH is connected to the SHD server, the Public Key is exchanged, the system checks the key stored in/etc/ssh_know_hosts. If the client finds the key, it generates a randomly generated session key and transmits it to the server. Both ENDS use this key to continue ssh.
The remaining stages. It generates identity. pub and identity files. Private keys are stored in identity, and public keys are stored in identity. pub, then use SCP to set the identity. pub copy to the Home Directory of the remote machine. authorized_keys under ssh. . Ssh/authorized_keys (this authorized_keys file is equivalent to the Protocol's rhosts file). Then, the user can log in without a password. RSA Authentication is definitely more secure and reliable than rhosts authentication. Run: SCP identity. pub. TW :. SSH/authorized_keys if you do not enter a password when using SSH-keygen to generate a key pair, as shown above, you do not need to enter a password to log in here. The password entered here can be different from the account password, you can also leave the password empty.

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.