A Beginner's Guide to Using SSH with PuTTY on Windows

A Beginner's Guide to Using SSH with PuTTY on Windows

Setting up SSH access to your server from a Windows machine? No worries! With PuTTY, you can securely connect to your server in just a few steps. Whether you’ve downloaded a .pem file or a .ppk file, I’ve got you covered. Let’s begin!

Step 1: Download and Install PuTTY

  1. Head over to the official PuTTY website.

  2. Download the Windows Installer for PuTTY.

  3. Run the installer and follow the steps to install.

  4. After installation, ensure you have:

    • PuTTY: The SSH client.

    • PuTTYgen: The tool to convert .pem files to .ppk (if needed).

Step 2: What Type of Key Do You Have?

  • If you already have a .ppk file (lucky you! 🎉), you can skip straight to Step 4.

  • If you have a .pem file, you’ll need to convert it to .ppk first. Let’s do that in the next step.

Step 3: Convert .pem to .ppk Using PuTTYgen

  1. Open PuTTYgen (installed with PuTTY).

  2. Click Load and navigate to your .pem file.

    • You might need to change the file type filter to All Files (*.*) to see your .pem file.

  1. Once loaded, click Save Private Key.

    • Choose a secure location to save the .ppk file.

    • You can skip setting a passphrase for now (though setting one adds extra security).

Tip: Keep your .ppk file safe! It’s your key to accessing the server.

Step 4: Retrieve Your Server Details

Before we proceed, make sure you have the following:

  • Public IP Address of the server (e.g., ec2-xx-xx-xx-xx.compute-1.amazonaws.com for AWS).

  • Default username for the server (e.g., ubuntu for Ubuntu, ec2-user for Amazon Linux).

Step 5: Configure PuTTY to Connect to Your Server

  1. Open PuTTY.

  1. Under the Session category:

    • Enter the Host Name (or IP address): <your-server-public-ip>.

    • Set the Port to 22 (default for SSH).

  1. Navigate to:

    • Connection → SSH → Auth → Credentials in the left-hand menu.

    • Click Browse and select your .ppk file.

  1. Optional (but handy!):

    • Under Connection → Data, set the Auto-login username to your server’s default username (e.g., ubuntu).

  1. Return to the Session category.

    • Enter a name for the session (e.g., MyServer).

    • Click Save to reuse these settings easily in the future.

Step 6: Connect to Your Server

  1. Back in the Session category, click Open to initiate the SSH connection.

  2. If this is your first time connecting to the server, PuTTY will show a Security Alert about the server’s host key.

    • Click Accept to proceed.

  1. Congrats! You’re now connected to your server.

Step 7: Verify Your Connection

Let’s make sure everything is working. Run these commands after logging in:

  • Check the server uptime:

      uptime
    
  • View the available disk space:

      df -h
    

Bonus: Troubleshooting Tips

  • Key Authentication Error: Ensure the correct .ppk file is selected in PuTTY.

  • Connection Timeout: Check if the security group allows SSH (port 22) from your IP address.

  • Invalid Username: Verify the default username for your server’s operating system.

Conclusion

Setting up SSH access with PuTTY on Windows isn’t as daunting as it seems. With your .ppk file in place and PuTTY configured, you’re all set to manage your server securely. Whether it’s launching applications, managing configurations, or simply learning Linux commands, your server is just a few clicks away.

Have questions or ran into issues? Drop a comment below, I’d love to help!