Installation via Windows

Launch the PuTTYgen application, or you can download the portable version for your system's architecture using one of the links below:

32-bit version: download
64-bit version: download

Click the Generate button and, for some time, move the mouse pointer randomly to ensure unique key generation.

The prepared text that we need to use later is in the Public key for pasting field.

Optionally, in the Key passphrase field, you can set an additional code for your key, which will be required each time you connect to the server. We will use the word "spacecore." Then, click the Save public key button to save the public key additionally, as mentioned above. Also, click Save private key and save the private key file, which will be required for future server connections. The filenames can be anything; it does not affect anything.

We have saved and obtained 2 files.

There are two ways to attach the SSH key to the server.

Using the nano Utility

After connecting to the server, we need to use the command:

nano /root/.ssh/authorized_keys


We entered the file editor for the authorized_keys file, which is responsible for SSH key configuration.

At the moment, the file is empty, and we need to fully copy all the text from the PuTTYgen window:

Then paste it into the editable file using the right mouse button (RMB).

Press the Ctrl + X key combination.

Confirm saving the file by entering the letter Y.
The SSH key is successfully associated with our server.

Transferring Data via sFTP

Connect to our server and see a list of files on the main page, go to the .ssh directory.

Here we see the authorized_keys file, which is currently empty and has a size of 0 bytes.

Right-click and open the file.

Paste the same public key from PuTTYgen here.

Save the changes and upload the file to the server.

Done, the SSH key is installed!

Connecting via SSH Key

When opening the PuTTY program, we enter the standard interface, where we need to enter the server's IP address.

In the left menu, expand the SSH tab and go to Auth.

Here we need to select the location of the private key file (note, not the public one!) with the .ppk extension.

After adding the key, click the Open button. The standard login input interface appears; fill it out.

After entering the username, we are prompted for the Passphrase code (we specified "spacecore" during key generation), enter it.

Congratulations, SSH key authentication was successful!

How to Save Server Data for Quick Access?

You need to enter the server's IP address and attach your private SSH key. Then specify the name of the saved session.

The session has been saved.

You can also specify the username before the IP address to expedite the login process, like this:
username@IP-address

Save it. Now, when you double-click the saved session, a window will open, where you should enter the private key code (only if you specified it). If there is no code, the connection will be established instantly without additional data entry.

Enter the code. Done, we are connected!