How to add an SSH key on the server?

In order to allow other users to log in to your server, you need to add the public SSH keys of these users. You can learn how to get them from the SSH key generation tutorial.

Adding an SSH key on the server

The manual describes the procedure using nano, but you can use any text editor.

1. Log in to the server.

2. Enter the command in the terminal nano .ssh/authorized_keys

3. Add a public SSH key in the open file on a new line. You can see how to generate it in our tutorial.

4. Save the changes to the file by clicking Ctrl+x, then y and finally Enter.

5. The file was saved. Now the owner of the added public key can log in to the server.

ssh key, add ssh key, klucze ssh, dodać klucz ssh, logowanie ssh, ssh login

Also Read