Linux uses private key (public key) login-password-free login

Source: Internet
Author: User

For a more secure and convenient login to the Linux server, you can log in using the private key, which is more convenient and more secure.

Generate key

With Xshell you can easily generate and manage private keys, click on the Tools menu and choose the New User Key Generation Wizard:

Click Next directly

Enter a name and password, then click Next

Save the public key for backup, and the public key needs to be uploaded to the Linux server.

Upload Public key

Log in with your username and password and enter the command

CD. SSH

Save the public key to the. SSH directory

The upload succeeds as shown in:

Import Public key

After the public key is uploaded, the public key needs to be imported

Cat Remoteppk.pub >> Authorized_keys

After the successful import, you can delete the remoteppk.pub file, of course, do not delete also no problem. The permission to modify the Authorized_keys file is 600, the default is 600, to prevent not, to reset it:

 *
Log on with a public key

Open user authentication, select the login method as public key, and select the key you just created, enter the password.

Cancel Password Login

Do so much, the purpose is to cancel password login, in the attempt to use the public key can log in after the normal, you can cancel the password login, delete the user's password directly

passwd-d Root

Original address: https://www.zkea.net/codesnippet/detail/post-75

Linux uses private key (public key) login-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.