Putty Configuration Tips and Tricks
- Connection timeout (s)
- 30 s
- You entered
- Keepalive interval (s)
- 0 s
- You entered
Putty is a free SSH and Telnet client for Windows that lets you securely connect to remote servers. This article covers the most useful configuration tips and tricks to make your Putty sessions faster, more secure, and easier to manage.
Formula
The calculator above is a simple helper for two common Putty settings. The connection timeout is the number of seconds Putty waits before giving up on a connection attempt. The keepalive interval is how often Putty sends a null packet to keep the session alive. The formula r = max(t, 15) suggests a keepalive interval that is at least 15 seconds, which is a good starting point for most networks.
Worked Example
If you set the connection timeout to 30 seconds and leave keepalive at 0 (disabled), the recommended keepalive is max(30, 15) = 30 seconds. This means you should set the keepalive interval to 30 seconds to prevent your session from timing out due to inactivity.
Why Putty Configuration Matters
Putty is a powerful tool, but its default settings are not optimized for every use case. Without proper configuration, you may experience dropped connections, slow performance, or security risks. By adjusting a few key settings, you can make your remote work much smoother.
Essential Putty Settings to Adjust
- Connection > Keepalive: Set the keepalive interval to 15-30 seconds to prevent idle sessions from disconnecting.
- Window > Appearance: Change the font size and cursor style for better visibility.
- Window > Translation: Set the character encoding to UTF-8 if you work with international text.
- Connection > SSH > Auth: Enable SSH agent forwarding if you need to use your local keys on the remote server.
How to Save and Load Sessions
Saving sessions is one of the most useful Putty features. After configuring a connection, type a name in the “Saved Sessions” box and click “Save”. You can then double-click that name to connect instantly. To manage multiple sessions, use the “Load” button to retrieve saved configurations. This saves time and ensures consistency across connections.
Using Putty with SSH Keys
SSH keys are more secure than passwords. To use them with Putty, you need to convert your private key to Putty’s format using PuTTYgen. Load your existing key into PuTTYgen, then save it as a .ppk file. In Putty, go to Connection > SSH > Auth and browse to that .ppk file. Now you can log in without typing a password.
Common Problems and Fixes
- Connection refused: Check that the server is running SSH and the port is open.
- Network error: Connection timed out: Increase the connection timeout or check your firewall.
- Server unexpectedly closed network connection: This often happens due to a keepalive issue; set a keepalive interval.
- Host key verification failed: This occurs when the server’s key changes; verify the new key with the server administrator.
Putty vs. Other SSH Clients
Putty is lightweight and portable, making it ideal for quick connections. Alternatives like Windows Terminal or MobaXterm offer tabbed interfaces and more features, but they are heavier. For simple SSH tasks, Putty remains a reliable choice.
Security Tips for Putty
- Always use SSH protocol 2, which is more secure than protocol 1.
- Disable SSH protocol 1 in the Connection > SSH settings.
- Use strong passwords or better, SSH keys.
- Keep Putty updated to the latest version to get security patches.
Frequently Asked Questions
How do I copy and paste in Putty?
Copying in Putty is automatic: just select text with the mouse, and it is copied. To paste, right-click anywhere in the terminal window. This behavior can be changed in the Window > Selection settings.
Why does my Putty session keep disconnecting?
This is usually due to network inactivity. Set a keepalive interval in Connection > Keepalive (e.g., 30 seconds) to send a packet regularly and keep the connection alive.
Can I use Putty on Mac or Linux?
Putty is primarily for Windows, but you can run it via Wine, or use the built-in SSH client in the terminal. For a native experience, consider using OpenSSH.
How do I change the default font size in Putty?
Go to Window > Appearance and click “Change…” next to Font. Select your preferred font and size. Save the session to make it permanent.
Is Putty safe to use?
Yes, Putty is widely used and considered safe. However, always download it from the official website and keep it updated to avoid security vulnerabilities.
Related
Formula used
in t | Connection timeout (s) | s | 30 | 0 in k | Keepalive interval (s) | s | 0 | 0 out r | Recommended keepalive | s | max(t, 15) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.