Connecting via SSH using the Putty key
This tutorial provides step-by-step instructions on how to install PuTTY SSH, use it, and configure key-based authentication. By following these instructions, you will be able to establish a secure connection to a remote server using PuTTY.
The challenges faced today
Business environments today often run multiple operating systems — both workstations and servers. Network devices, Linux servers, IoT systems, and Linux workstations frequently need to connect from a Windows workstation. Securely bridging these environments while protecting data remains a major challenge. A tool like PuTTY can help address this effectively.
SSH - what is it?
Secure Shell (SSH), also known as Secure Socket Shell, is a network protocol that enables secure access to computers over unsecured networks. It is especially popular among system administrators.
The SSH protocol is implemented through a suite of utilities. Using Secure Shell, you can securely communicate between two computers over an open network (such as the Internet) with strong password authentication or public key authentication.
Network administrators use SSH to remotely access another computer, execute commands, transfer files, and provide strong encryption.
With SSH, you can securely access a computer or device over an insecure network. SSH connections are commonly used to remotely configure Linux servers and network devices.
What is PuTTY?
PuTTY is a free, open-source SSH client for Windows. It is one of the most popular tools for connecting to Linux servers securely from a Windows computer.
With PuTTY you can:
- Connect to your server using password or SSH-key authentication
- Run commands remotely
- Transfer files (via PSCP or built-in SFTP in PuTTY)
- Manage your Linux server without any graphical interface
PuTTY is lightweight, fast, regularly updated and works perfectly with all modern Linux distributions (Ubuntu, Debian, AlmaLinux, Rocky Linux, etc.).
The package also includes PuTTYgen – a simple tool to generate SSH key pairs, which we will use in this guide.
How to install PuTTY
First, download the PuTTY package from the official website. Visit puttygen.com to get PuTTY for your operating system.
To install PuTTY on your Windows system, follow these simple steps:
1. Select the appropriate package for your system architecture — 32-bit or 64-bit. The download page offers individual executable files, including putty.exe (the SSH client) and puttygen.exe (the key generation utility).

2. Download putty.exe and puttygen.exe. Save them to an easily accessible location on your computer.
Generating SSH Keys
Launch the PuTTYgen utility and click the Generate button. During generation, move your mouse cursor randomly over the blank area to create entropy for the key.

Once generation is complete, the public key appears in the text area. The tool also displays the key fingerprint and allows you to add a comment.

Use the "Save public key" and "Save private key" buttons to store the keys on your computer. For added security, set a passphrase to protect the private key.
Adding the Public Key to the Server
Next, add the public key to the target server.
Connect to the server via SSH using your password, then open the file .ssh/authorized_keys in the user's home directory. Append the following line to the end of the file:
ssh-rsa your_public_key_here

In this example, we are using the root account, so the file path is /root/.ssh/authorized_keys. Copy the public key directly from the PuTTYgen window (the text area at the top).

Configuring PuTTY for Key Authentication
Open the PuTTY application. In the main window, enter the server's IP address in the "Host Name (or IP address)" field, ensure the port is 22, and the connection type is SSH.

Before connecting, specify the private key path. In the left panel, go to Connection → SSH → Auth → Credentials and browse to your private key file (with the .ppk extension) in the "Private key file for authentication" field.
Return to the Session category, enter the server address, and click Open to connect.
PuTTY will prompt for the username. Enter the account name for which you added the public key (in our case, root). You will then gain access to the server console.
If the private key has a passphrase, you will be asked to enter it after providing the username. Note that this passphrase protects your SSH key and is separate from the account password.
Success! Key-Based Authentication Works
If everything is set up correctly, PuTTY will connect to the server without prompting for the account password (only the key passphrase, if one was set). The terminal opens immediately with the command prompt, allowing you to run commands right away.
Congratulations! You can now securely and conveniently manage your remote server without entering passwords every time.