Linux ssh password-free login

Source: Internet
Author: User

1. Generate Secret Key

① generate key file: ssh-keygen-t RSA, then you can always return to completion.

② this time, a. SSH directory is generated in the root directory, and you can see the generated key file by looking at the directory:

2. Install the public key

    Cat Id_rsa. Pub >> authorized_keys

3, modify the permissions of the file, to ensure that you can have permission to execute

chmod Authorized_keys

chmod. SSH

  

4, set up SSH, open key login function

① Modify Sshd_config File: Vim/etc/ssh/sshd_config

② Open the key login function, probably in the file of 35 lines, remove the previous # number can be:

  

③ Restart SSH Service

Systemctl Restart sshd

5. Make Login Key file

① Copy the key file Id_rsa to the client

② open Puttygen, load in standalone actions, select our Id_rsa key

③ Click Save Private Key to save the secret key as a PPK file so that you can log in with the Putty secret key.

④ If you need a secret key for. Pub, you can use the generated id_rsa.pub directly

6. Close Password Login

① Verify that you can log on by using the secret key and then modify the Sshd_config file again: Vim/etc/ssh/sshd_config

② Disable password login:passwordauthentication No, at the bottom of the document, change Yes to no

③ Restart SSH Service

Linux ssh password-free login

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.