Linux SSH Create password-free login public key

Source: Internet
Author: User

If the two machines often have the action of the packet, such as the compiler to the publisher, or provide the tool to install the media machine to other machines, often log in need to enter a password is more troublesome, and the script also requires a password is not secure.

Is there a good way? There are, and very simple, the following sections easy to complete!

The popular Speaking

A machine needs to log on to the B machine often, then put a's public key to B,  so B will know a, the  next time a login B will not need to say hello

Specific steps

#1 Enter the $HOME/.ssh directory of a machine to view the *.pub file cat $HOME/.ssh/id_dsa.pub#2 Copy the content, enter the B machine, paste the copied content into the following file VI $HOME/.ssh/authorized_ Keys#3 to exit after saving. Then execute the SSH username @ip on the A machine and you can log in directly

Or

#1 Copy the public key of a host to Host B, you need to modify the path, you need to enter the password. (preferably do not directly overwrite the Authorized_keys file) SCP  $HOME/.ssh/id_dsa.pub user name @ip:/$HOME/.ssh#2 into the B machine CD  $HOME/.ssh; Cat id_ Dsa.pub >> authorized_keys#3 exit after saving. Then execute the SSH username @ip on the A machine and you can log in directly

The two methods are essentially the same, the difference is that one is copy, one is to read the file appended to the file content to another file, according to the actual situation and personal habits to choose.

Linux SSH Create password-free login public key

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.