Key authentication on a node

Introduction

This article demonstrates how to reconfigure an existing SSH node to use Public Key Authentication.

If you wish to see this article as a rolling demo, there is a Youtube Video available which you may watch instead.

 

Step 1: Create a new Key

keyauth1.png

keyauth2.png

Navigate to Private Keys and click Generate Key.

 

keyauth3.png
Give the key a name and select the Type and Bit length for the key. You can choose between RSA, DSA and ECDSA for the Type and 1024, 2048 and 4096 for Bits.

Click Generate Key.

 

Step 2: Install Public Key on SSH server

 

keyauth4.png
Click the green gears icon and select Download Public Key. We will need this to upload to the SSH server shortly.

 

keyauth5.png
Open the downloaded pub file and copy the contents to the clipboard.

In this example, we already have a Gateway Node configured for the target SSH Server, but it is configured to use Username and Password authentication.

 

keyauth6.png
We can therefore connect to the node using the SSH Gateway, using the nshell command.

 

keyauth7.png
In the node, cd into the .ssh directory and paste the contents of the key into the authorized_keys file.


Exit from the node when finished.

 

Step 3: Reconfigure Gateway Node

keyauth8.png
Back in the web UI, navigate to Gateway Nodes and edit the existing node we just connected to.


Select the Authentication tab and change the Authentication Mode to Public Key, then in the next drop down select the Private Key that we created earlier.

Click Update to save the resource.

 

Step 4: Testing

keyauth9.png
Back in PuTTY, let's reconnect to the node using nshell and check the logs to ensure we actually did connect using the public key.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.