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.