How to configure PuTTY to use the public key for automatic login authentication

Source: Internet
Author: User
Run puttygen.exe and select the type and length of the key. We can select SSH2 (RSA) and set the length to 1024.

Step 1: generate a key
Run puttygen.exe and select the type and length of the key. We can select SSH2 (RSA) and set the length to 1024.

The key password and the Confirm password can be left blank after generation.
This is the password used to protect the private key. if there is no special security requirement,
Do not enter a password when logging on.

Click the Save Private Key button to save the private key (here we do not save the public key. during the upload, copy it directly from the generated box), for example, elins. ppk

Step 2: upload the key
Log on to the remote system with your account and run the following command:
Cd ~
Mkdir. ssh
Cd. ssh
Cat> authorized_keys

Note: Copy the public key generated from puttygen.exe directly if it is copied from the file. The following problems may occur:

Server refused our key.

Select all the content, press Ctrl + C to copy it to the clipboard, press Shift + Ins in the Putty window, and press Ctrl + D to create the file.

Step 3: Set Putty
Start Putty, set the parameters of the session, select "SSH-> Authentication" on the left, click the Browse button, and select the elins. ppk file. Select a session from the left and click save to save the modification. Click the open button to log on. If there are no problems with the above operations, then the system should automatically log on without entering the password.

In addition, if the key is rejected, set authorized_keys to 644, that is, chmod 644. ssh/authorized_keys.

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.