enable key based authentication
1. Generating Keys
1.2 Generate randomness to create keys.
The key passphrase option enables additional security.
2. Adding the public key to server
2.1 Adding key
# vi /root/.ssh/authorized_keys
[root@hostripples ~]# chmod 600 /root/.ssh/authorized_keys [root@hostripples ~]# chmod 700 /root/.ssh/
vi /etc/ssh/sshd_config . AuthorizedKeysFile .ssh/authorized_keys .
If you need to enable only key based authentication in your server, disable password authentication.
[root@vps ~]# /etc/init.d/sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ]
3, Final step : Connecting to server
Now we have to check whether the keys are working. Please follow the steps to connect server using key.
3.1 Create a “Saved Session”
Here you need to create a new saved session for your key based connection. Mention server IP address, SSH port and session name.
3.2 Add user name
Under “Connections >> Data” add user name to connect to server.
3.3 Add private key
Under “Connections >> SSH >> Auth” you can select the private key that we saved in our machine.
That’s it! Then come to session and save.
Try to connect now