Setting up an SSH connection using key authorization

If you often use SSH to work with the server, then you will probably like the idea of not entering a password each time, but automatically accessing the SSH server using key authorization. Below is an example of setting up such authorization.

1. Using PuttyGen, generate private and public ssh keys - the Generate button. In the settings, you can specify the key type and its size. When generating a key, you must move the mouse in the utility window in any order.

2. After that, without filling in the Passphrase field, save the private key to a file using the Save private key button, for example private.key. The public key is displayed in the upper Key field and looks like this:
 "ssh-rsa AAAAB3NzaC1yc*что-то*uJQ== rsa-key-20020104".

2. Copy the contents of the Public key for pasting into OpenSSH authorized_keys file field to RAM and close PuttyGen.

3. Launch the Putty ssh client and connect to the ssh.login.nichost.ru server with the login and password from the «Hosting Control Panel».

4. Once on the server, create the /home/login/.ssh folder

5. Create the /home/login/.ssh/authorized_keys file with the contents of the Public key for pasting into OpenSSH authorized_keys file field of the PuttyGen utility (what was copied to RAM).
NOTE: the key in the file must be written in one line without line breaks.

6. Change the file access rights with the command chmod 600 /home/login/.ssh/authorized_keys

7. Close Putty.

8. Launch Putty. In your connection settings, specify the path to the private key:



9. Save the connection settings and connect to the server. The SSH server will ask for the username under which you want to log in - specify your login. Then authorization will take place using the private and public ssh keys.

Всё ещё остались вопросы?