SCP command to set password-less

Source: Internet
Author: User
Tags scp command

The SCP command sets a password-less job on jenkins today, You need to copy the file to a remote machine and think of the frequently used scp command. However, this command is convenient, but requires a password. How can I use this command in the script? There are many solutions to view Google, one of which is to establish secure communication between two hosts through the key. The process is as follows: the Linux code ssh-keygen-t rsa is the same as the process of generating the key when using Git. You need to upload the generated public key to the target machine. In this case ~ A. ssh directory is generated under the directory. Check that there are three files under the file: Linux code id_rsa id_rsa.pub known_hosts. They are private keys, public keys, and known hosts. Use the scp command to copy the public key to the remote host and change the file name to authorized_keys Java code scp id_rsa.pub root @ remote_ip :~ /. Ssh/authorized_keys is OK. You do not need to enter the password when using the scp command to copy the file to the remote end.
 

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.