Connecting via SSH using the Putty key | INTROSERV

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).

PuTTY download options table showing 32-bit and 64-bit versions

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.

PuTTYgen generating key — move mouse for entropy

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.

PuTTYgen with generated public and private keys ready to save

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

Editing .ssh/authorized_keys file on the server

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).

Copying the public key from PuTTYgen

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.

PuTTY main session window with host and port configured

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.

Successful PuTTY SSH connection using public key authentication: terminal showing htop process monitor
Successful public key login example: the terminal opens instantly with no account password required. Here, htop is running to display server processes — proof that key-based authentication is working perfectly.

Congratulations! You can now securely and conveniently manage your remote server without entering passwords every time.

VAT

  • Other

    Other

    0%
  • austria

    Austria

    20%
  • Belgium

    Belgium

    21%
  • Bulgaria

    Bulgaria

    20%
  • Croatia

    Croatia

    25%
  • Cyprus

    Cyprus

    19%
  • Czech Republic

    Czech Republic

    21%
  • Denmark

    Denmark

    25%
  • Estonia

    Estonia

    22%
  • France

    France

    20%
  • Finland

    Finland

    24%
  • Germany

    Germany

    19%
  • Greece

    Greece

    24%
  • Hungary

    Hungary

    27%
  • Ireland

    Ireland

    23%
  • Italy

    Italy

    22%
  • Latvia

    Latvia

    21%
  • Lithuania

    Lithuania

    21%
  • Luxembourg

    Luxembourg

    17%
  • Malta

    Malta

    18%
  • Netherlands

    Netherlands

    21%
  • Poland

    Poland

    23%
  • Portugal

    Portugal

    23%
  • Romania

    Romania

    19%
  • Slovakia

    Slovakia

    20%
  • Slovenia

    Slovenia

    %
  • Spain

    Spain

    21%
  • Sweden

    Sweden

    25%
  • USA

    USA

    0%
european
states
  • Other
  • canada
  • poland
  • european-union
  • france
  • germany
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria
  • austria