Table of Contents
Key generator is available with Putty to generate private and public keys. You can download PuttyGen from here, download Putty.Gen.
1.1 Open PuttyGen and click on Generate button to create your keys.
1.2 Generate randomness to create keys.
The key passphrase option enables additional security.
1.3 Save private key on the local machine.
After generating keys we need to add the public key into the server’s authorized_keys file. This file is in the location “/root/.ssh/authorized_keys“;
# vi /root/.ssh/authorized_keys
If it’s not there, create it.
For security reasons, change the file and folder permissions as follows:
vi /etc/ssh/sshd_config . AuthorizedKeysFile .ssh/authorized_keys .
If you need to enable only key based authentication in your server, disable password authentication.
PasswordAuthentication no
[root@vps ~]# /etc/init.d/sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ]
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
Ah, the joys of building a website! Picture this: You're sitting there in your pajamas, coffee in hand, ready to…
Are you feeling like your website is running in slow motion? It can be frustrating when your online presence doesn't…
Are you ready to take your online store to the next level? Whether you're running a PrestaShop or OpenCart platform,…
Picture this: your website is like a fabulous party happening in the darkest corner of the internet, but nobody's showing…
Picture this: Your WordPress site is like that one friend who's always fashionably late to everything. You know, the one…