Configure _No Password SSH Keys Authentication_ with PuTTY on Linux Servers

SSH (Secure Shell) is a popular protocol for securely connecting to remote servers over a network. When you use SSH to connect to a server, you typically need to provide a username and password to authenticate your identity. However, this process can be tedious if you need to connect to multiple servers frequently. Fortunately, there is a solution: No Password SSH Keys Authentication.

In this article, we'll walk you through the process of setting up No Password SSH Keys Authentication on a Linux server using PuTTY, a popular SSH client for Windows. With this setup, you can connect to your servers quickly and securely without needing to type in a password every time.

Prerequisites

Before we begin, make sure you have the following

  • A Linux server to which you want to connect using SSH.

  • PuTTY installed on your Windows machine. You can download PuTTY from the official website.

  • Basic knowledge of Linux commands and how to use the command line.

Why Use No Password SSH Keys Authentication?

There are several benefits to using No Password SSH Keys Authentication

  • Improved security SSH keys provide a more secure way to authenticate than passwords, as they are much more difficult to guess or crack.

  • Convenience With SSH keys, you don't need to remember or enter a password every time you connect to a server.

  • Automation SSH keys can be used to automate tasks on remote servers, such as running scripts or executing commands.

How SSH Key Authentication Works

SSH Key Authentication Process Client (Private Key) Server (Public Key) 1. Connection Request 2. Challenge 3. Signed Response 4. Authentication Success

Generating SSH Keys with PuTTYgen

To use No Password SSH Keys Authentication, you'll need to generate a public/private key pair. PuTTYgen is a tool used to generate and manage SSH keys with PuTTY.

Follow these steps to generate an SSH key with PuTTYgen

  1. Download and install PuTTY from the official website.

  2. Open PuTTYgen by searching for it in the Start menu.

  3. Click the Generate button to create a new key pair. Move your mouse around the blank area to generate random data for the key.

  4. Set a passphrase for your private key. This passphrase will be required to use the private key, so make sure to remember it.

  5. Click the Save private key button to save your private key. Choose a secure location to save the file.

  6. Copy the contents of the Public key for pasting into OpenSSH authorized_keys file field to your clipboard. This is your public key.

Adding the Public Key to the Server

Now that you have generated your SSH key pair, you'll need to add the public key to the authorized_keys file on the Linux server you want to connect to. Follow these steps

  1. Log in to the Linux server using your password.

  2. Create a .ssh directory in your home directory if it doesn't already exist

    mkdir -p ~/.ssh
  3. Open the authorized_keys file in a text editor

    nano ~/.ssh/authorized_keys
  4. Paste the contents of the public key you copied earlier into the authorized_keys file.

  5. Save and close the file by pressing Ctrl+X, then Y, then Enter.

  6. Set the correct permissions for the .ssh directory and authorized_keys file

    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys

Configure PuTTY to Use Private Key

The final step is to configure PuTTY to use your private key when connecting to the Linux server. Here's how to do it

  1. Open PuTTY, and go to the Session category.

  2. Enter the hostname or IP address of the Linux server in the Host Name (or IP address) field.

  3. Under the Connection category, expand the SSH subcategory, and click on Auth.

  4. Click the Browse button next to the Private key file for authentication field, and select the private key file that you saved earlier.

  5. Click the Open button to start the SSH session.

You should now be able to connect to the Linux server without needing to enter a password. PuTTY will automatically use the private key for authentication.

SSH Agent Forwarding with PuTTY

SSH agent forwarding is a useful feature that allows you to use your SSH keys on a remote server. This is useful if you need to connect to multiple servers using the same key, or if you need to perform multiple SSH hops to reach a remote server.

To enable SSH agent forwarding

  1. Enable SSH agent forwarding on the remote server by adding the following line to the SSH configuration file (/etc/ssh/sshd_config)

    AllowAgentForwarding yes
  2. Restart the SSH service on the remote server

    sudo systemctl restart sshd
  3. In PuTTY, go to Connection ? SSH ? Auth and check Allow agent forwarding.

Troubleshooting

If you are unable to connect to the Linux server using your private key, try the following troubleshooting steps

Issue Solution
Connection refused Verify the public key is correctly added to ~/.ssh/authorized_keys
Permission denied Check permissions: chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys
Key not recognized Ensure the private key file is in PuTTY format (.ppk) and correctly selected
Still prompts for password Verify SSH key authentication is enabled in /etc/ssh/sshd_config

Conclusion

No Password SSH Keys Authentication is a convenient and secure way to connect to Linux servers without repeatedly entering passwords. By generating SSH key pairs with PuTTYgen and configuring them properly on both client and server, you can streamline your remote access workflow while maintaining strong security. The key-based authentication method is not only more secure than passwords but also enables automation and simplified server management.

Updated on: 2026-03-17T09:01:38+05:30

668 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements