Use ssh-keygen for password-free login to linux

Source: Internet
Author: User

Use ssh-keygen, implement password-free login to linux host 192.168.1.2 server 192.168.1.3 first generate key ssh-keygen-t rsa in the user directory of the local host and press four enter keys as prompted, the key to be used is generated. the generated file id_rsa.pub is displayed in the ssh/directory and uploaded to the root directory of the server. scp-p id_rsa.pub username@192.168.1.3 :. ssh/rename id_rsa.pub to mv id_rsa.pub authorized_keys on the server. If authorized_keys already exists on the server, now you can use cat id_rsa.put> authorized_keys to append the key we generated to the back of the authorized_keys file. Then you can change the File Permission chmod 600 authorized_keys OK now you can directly use the ssh userName@192.168.1.3 locally logged on, no Password

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.