The issue of entering a password in the shell script to resolve the SCP command

Source: Internet
Author: User
Tags scp command
Use the key file. This assumes that host a (192.168.100.3) is used to obtain a file for Host B (192.168.100.4). Execute the following command on host A to generate the pairing key: ssh-keygen-t RSA encounters a prompt to enter by default, and the public key is stored in the user directory. The SSH directory, such as root, is stored in:/root/.ssh/id_rsa.pub. Id_ in the. SSH directory Rsa.pub file is copied to host B's ~/.ssh/directory and renamed Authorized_keys to host A to execute commands and Host B to establish trust, example (assuming Host B's IP is: 192.168.100.4): SCP ~/.ssh/id_ Rsa.pub 192.168.100.4:/root/.ssh/authorized_keys Below you can use the SCP, SSH command do not need a password to get Host B files ssh 192.168.100.4 Enter will not need a password. Note: In fact, id_rsa.pub content added to the other machine Authorized_keys in the line reproduced: http://blog.csdn.net/chris_playnow/article/details/22579139

The issue of entering a password in the shell script to resolve the SCP command

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.