Skip to main content

Accessing a Remote Server via Public-Key Authentication

By Tuesday June 28th, 2016Tips & Tricks

With Xshell, you can easily generate a public key and register it to a server. In another article, we went over how to generate a public/private key pair. From the User Key manager, access the key properties and navigate to the Public Key tab.

public key_en
Copy the entire public key to your clipboard and we will register it to our server.

First, we’ll need to ssh to the server using password authentication. From there, we’ll need to edit the sshd_config file. (Default location is “/etc/ssh/sshd_config”)
Confirm the current file name of the AuthorizedKeysFile and create a file in its location to register your public key. We’ll proceed using the default file name of ~/.ssh/authorized_keys.

139

Edit the ~/.ssh/authorized_keys file and we’ll paste the public key we copied above. (If the file doesn’t exist in the directory, create it).

140

Now in Xshell, go to your session’s properties and set Authentication as Public Key. Select your user key and enter the credentials.

session_en
Now everything has been set and you can connect via the session file!

Login

Leave a Reply

3 + 13 =