Recently engaged in a VPS, with Putty landing every time to enter the root account password, more trouble, so the internet to find the SSH certificate method.
In fact, this should be the Putty recommended authentication method.
1. Generate the key using the Putty SSH key generation tool Puttygen.exe.
Generated key type and number of bits by default, SSH-2 rsa,1024 bit
Save the private key to local, you will be prompted to save the private key to set a password, no password more convenient.
2. Configure the Linux SSH login (root user, ~ is/root)
First log in to the remote Linux system and create the ~/.ssh/authorized_keys.
CD ~
mkdir ~/.ssh
VI ~/.ssh/authorized_keys
Paste the public key content generated by Puttygen.exe to ~/.ssh/authorized_keys.
As for why the file name is Authorized_keys, you can find the following two lines in the/etc/ssh/sshd_config
#PubkeyAuthentication Yes
#AuthorizedKeysFile. Ssh/authorized_keys
3. Log in to your Linux server with an SSH certificate/vps
putty→ session: Fill in the server IP
putty→ connection → Data: Fill in the automatic login user name (such as root)
putty→ Connection →ssh→ Authentication: Select Authentication private Key File
Back to putty→ session: Save the session, fill in a name to save it, next time directly double-click on the name to log in
4. For security you need to cancel the password authentication method of SSH.
This step can be done without doing, you can refer to the following links.
Reference Links:
http://www.shipingzhong.cn/node/944
Deploying an SSH certificate to enable Putty password-free login to Linux