Linux uses ssh password-free remote login to another host

Source: Internet
Author: User
Linux uses ssh password-free remote login to another machine. 1. use the ssh-keygen command under your own machine (master) to create a public key, if you use ssh-keygen-trsa to create a directory, the program will ask you about the directory you store. if you do not need to modify it, press enter several times. 2... linux uses ssh password-free remote login to another machine. 1. use the ssh-keygen command under your own machine (master) to create a public key, if you use ssh-keygen-t rsa to create an rsa file, the program will ask you about the directory to store. if you do not need to modify it, press enter several times. 2 ~ /. Copy the id_rsa.pub file in the ssh directory to the server (controlled end) you want to log on ~ /. Ssh directory, and then run the following command to import the public key ~ /. Ssh/authorized_keys: cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys # execute the command on the logged-in side. 3. set the permission on the logged-in side :~ /. Set the ssh permission to 700 ~ /. Set the ssh/authorized_keys permission to 600, which is a security requirement for linux. if the permission is incorrect, automatic logon will not take effect. 4. log out of the server and then use ssh to log on, you will find that the server will not ask you for the password again. 5. because it is very troublesome to copy files, the following provides more convenient methods to run on the Master Terminal: a. run: ssh-keygen-t rsa B, and then press Enter (default) c. run: ssh-copy-id-I/root /. ssh/id_rsa.pub root@192.168.1.13 d, enter the password of the controlled end, you can. At this time, if the control end accesses the control end in turn, it also needs to lose the password.
 
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.