Using PuTTY on Windows | Generated by AI

Home PDF

PuTTY is a free, open-source terminal emulator and SSH client widely used for establishing secure connections to remote servers. This guide provides a detailed walkthrough on downloading, installing, configuring, and using PuTTY on Windows, including advanced features like SSH key authentication, file transfers, and port forwarding. It also covers troubleshooting common issues and tips for optimizing your PuTTY experience.


Table of Contents

  1. What is PuTTY?
  2. Downloading and Installing PuTTY
  3. Basic Configuration and Connecting to a Server
  4. Advanced Configuration Options
  5. Using PuTTYgen for SSH Key Authentication
  6. File Transfers with PSFTP and PSCP
  7. Port Forwarding and Tunneling
  8. X11 Forwarding for Graphical Applications
  9. Troubleshooting Common Issues
  10. Tips and Best Practices
  11. Alternatives to PuTTY
  12. Conclusion

What is PuTTY?

PuTTY is a versatile terminal emulator and network client developed by Simon Tatham, primarily for Windows but also available for Linux and macOS. It supports multiple protocols, including:

PuTTY is lightweight, highly configurable, and includes tools like PuTTYgen (for generating SSH keys) and PSFTP/PSCP (for file transfers). It’s widely used by system administrators, developers, and IT professionals for managing remote servers.


Downloading and Installing PuTTY

Step 1: Download PuTTY

  1. Visit the official PuTTY website at www.putty.org or the download page at chiark.greenend.org.uk/~sgtatham/putty/latest.html.
  2. Choose the appropriate installer:
    • 32-bit or 64-bit MSI installer: Select putty-<version>-installer.msi based on your system (64-bit is recommended for modern PCs).
    • Individual binaries: Download putty.exe, puttygen.exe, psftp.exe, etc., if you prefer not to use an installer.
  3. If unsure about your system type, the 32-bit version is universally compatible.

Step 2: Install PuTTY

  1. Double-click the downloaded .msi file to launch the PuTTY Setup Wizard.
  2. Click Next on the Welcome screen.
  3. Accept the default destination folder (usually C:\Program Files\PuTTY\) or choose a custom location, then click Next.
  4. Select desired features (e.g., create a desktop shortcut) and click Install.
  5. If prompted by Windows User Account Control, click Yes.
  6. Once installation completes, click Finish.

Step 3: Verify Installation


Basic Configuration and Connecting to a Server

Launching PuTTY

  1. Open PuTTY from the Start menu or desktop shortcut. This opens the PuTTY Configuration window, which has:
    • A left pane for configuration categories.
    • A middle section for entering connection details.
    • A lower-right section for saving session profiles.

Connecting to a Server

  1. Enter Host Details:
    • In the Host Name (or IP address) field, enter the server’s domain name (e.g., students.example.edu) or IP address (e.g., 192.168.1.1).
    • Ensure the Port is set to 22 for SSH (default) or the port specified by your server admin.
  2. Select Connection Type:
    • Choose SSH (default) for secure connections. Other options include Telnet, Rlogin, Raw, or Serial.
  3. Save a Session (optional):
    • Enter a name in the Saved Sessions field (e.g., MyServer).
    • Click Save to store the configuration for future use.
  4. Connect:
    • Click Open to initiate the connection.
    • If connecting for the first time, a PuTTY Security Alert may appear, warning that the server’s host key is not cached. Click Yes to trust the server and proceed.

Logging In


Advanced Configuration Options

PuTTY’s configuration window offers extensive options for customization. Below are key categories and settings:

Session

Terminal

Window

Connection

Saving and Loading Sessions

  1. After configuring settings, return to the Session category.
  2. Enter a name in the Saved Sessions field and click Save.
  3. To load a saved session, select it from the list, click Load, then Open.

Using PuTTYgen for SSH Key Authentication

SSH key-based authentication is more secure than password-based authentication. PuTTYgen generates key pairs in PuTTY’s .ppk format.

Step 1: Generate a Key Pair

  1. Open PuTTYgen from the Start menu or C:\Program Files\PuTTY\puttygen.exe.
  2. Select a key type (e.g., RSA, default, or ECDSA) and bit length (e.g., 2048 or 4096 for RSA).
  3. Click Generate and move your mouse to create randomness until the progress bar completes.
  4. Optionally, set a passphrase for added security.
  5. Save the private key (.ppk file) to a secure location.
  6. Copy the public key displayed in the “Public key for pasting into OpenSSH authorized_keys file” field.

Step 2: Configure the Server

  1. Connect to the remote server using password-based authentication (or another method).
  2. Create or edit the ~/.ssh/authorized_keys file:
    • Run mkdir ~/.ssh && chmod 700 ~/.ssh to create the .ssh directory.
    • Open the authorized_keys file with a text editor (e.g., nano ~/.ssh/authorized_keys).
    • Paste the public key and save the file.
    • Set permissions with chmod 600 ~/.ssh/authorized_keys.
  3. Log out of the server.

Step 3: Configure PuTTY for Key Authentication

  1. Open PuTTY and load your saved session.
  2. Navigate to Connection > SSH > Auth > Credentials.
  3. Click Browse next to “Private key file for authentication” and select your .ppk file.
  4. Return to the Session category, save the updated session, and click Open.
  5. Enter your passphrase (if set) when prompted. You should now connect without a password.

File Transfers with PSFTP and PSCP

PuTTY includes PSFTP (for SFTP) and PSCP (for SCP) for secure file transfers.

Using PSFTP

  1. Open PSFTP from the Start menu or C:\Program Files\PuTTY\psftp.exe.
  2. Type open <hostname> (e.g., open students.example.edu) and press Enter.
  3. Log in with your credentials or private key.
  4. Use commands like:
    • ls or dir: List files.
    • get <filename>: Download a file.
    • put <filename>: Upload a file.
    • cd <directory>: Change directory.
    • quit: Exit PSFTP.

Using PSCP

  1. Open a Command Prompt or PowerShell.
  2. Navigate to the PuTTY installation directory (e.g., cd C:\Program Files\PuTTY).
  3. Run commands like:
    • pscp <local_file> <username>@<hostname>:<remote_path> to upload.
    • pscp <username>@<hostname>:<remote_file> <local_path> to download.
    • Add -i <private_key.ppk> for key-based authentication.

Note


Port Forwarding and Tunneling

PuTTY supports SSH tunneling (port forwarding) to securely access services on remote servers.

Local Port Forwarding

  1. In PuTTY, go to Connection > SSH > Tunnels.
  2. Enter a Source port (e.g., 8080) on your local machine.
  3. Enter the Destination (e.g., remote_host:80) for the remote service.
  4. Select Local and click Add.
  5. Save the session and connect.
  6. Access the service locally (e.g., http://localhost:8080).

Remote Port Forwarding

Dynamic Port Forwarding


X11 Forwarding for Graphical Applications

PuTTY supports X11 forwarding to run graphical applications on a remote server and display them locally.

  1. Install an X server on Windows (e.g., XMing, a free option).
  2. In PuTTY, go to Connection > SSH > X11.
  3. Check Enable X11 forwarding.
  4. Set X display location to localhost:0.0.
  5. Save the session and connect.
  6. Run graphical commands (e.g., xterm) on the server, and the interface will display locally via XMing.

Troubleshooting Common Issues

  1. “Access Denied” Error:
    • Verify username, password, or private key.
    • Ensure SSH access is enabled on the server (e.g., check hosting control panel settings).
    • Check if the server requires key-based authentication only.
  2. “Connection Reset by Peer”:
    • Enable Keepalives in Connection settings to prevent timeouts.
    • Check firewall or network device settings that may close idle connections.
  3. “Server’s Host Key Not Cached”:
    • This is normal for first-time connections. Click Yes to cache the key. If it appears repeatedly, verify the server’s authenticity to rule out a man-in-the-middle attack.
  4. Failed Login Attempts Warning:
    • Reset your password or check for brute-force protection on the server.
    • Contact your server admin if locked out.
  5. PuTTY Window Closes Unexpectedly:
    • Check server logs for errors (e.g., incorrect permissions on ~/.ssh/authorized_keys).
    • Ensure the correct private key is loaded.

Tips and Best Practices


Alternatives to PuTTY

While PuTTY is reliable, modern alternatives offer enhanced features:


Conclusion

PuTTY is a powerful and flexible tool for managing remote servers on Windows. This guide covers its core functionalities, from installation to advanced features like SSH key authentication, file transfers, and tunneling. By following the steps and best practices outlined, you can efficiently use PuTTY to securely access and manage remote systems. For additional features or a more modern interface, consider exploring alternatives like WinSCP or MobaXterm.

For further details or updates, visit the official PuTTY website at www.putty.org or consult server-specific documentation from your hosting provider.


If you have specific questions or need help with a particular PuTTY feature, let me know!


Back 2025.05.29 Donate