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?
System administrators rely on SSH (Secure Shell) to establish secure connections with remote devices and perform tasks efficiently. Here are some of the key activities sysadmins carry out using SSH:
1. Audit Log Files in /var/log:
By connecting via SSH, they navigate to the /var/log directory and analyze log files to identify anomalies or potential issues.
2. Edit Configuration Files in /etc:
Sysadmins use SSH to access the /etc directory and modify configuration files as needed.
3. Update Software using DNF or APT:
Through SSH, they can use package managers like DNF (Dandified Yum) or APT (Advanced Package Tool) to download and install updates seamlessly — keeping systems current with the latest security patches, bug fixes, and features.
4. Connect to Network Devices:
SSH is a critical tool for connecting to various network devices, including routers and managed switches.
5. Enable or Disable Switch Ports:
Sysadmins frequently enable or disable individual switch ports to manage network connectivity efficiently.
6. Manage Routing Tables:
Using SSH, they connect to routers and managed switches to access and modify routing table configurations.
7. Configure Routing Protocols Remotely:
SSH allows sysadmins to remotely configure routing protocols on network devices — whether OSPF (Open Shortest Path First), BGP (Border Gateway Protocol), or EIGRP (Enhanced Interior Gateway Routing Protocol).
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.