PuTTY is a lightweight, long-established SSH client for Windows, handy when you want saved sessions and a graphical settings window. In this guide you will connect to your VPS Linux Infrawire, keep the session alive, switch to key authentication with PuTTYgen and Pageant, and transfer files with pscp.
📋 Prerequisites
- Windows 10 or 11.
- A Linux VPS that is running (Ubuntu 24.04, Debian 12, AlmaLinux 9 or Rocky 9).
- The VPS IP address and root password: from your customer area you can find the IP and the root password of the VPS.
- PuTTY installed, which includes
putty.exe,puttygen.exe,pageant.exeandpscp.exe.
If you use winget, the installation takes one line in PowerShell:
PowerShellwinget install PuTTY.PuTTY
🔌 Create and save a session
- Start PuTTY. In the Session category, enter
VPS_IPin Host Name (or IP address). - Keep Port at
22(or your custom port) and Connection type on SSH. - In the Saved Sessions box type a name such as
myvps, then click Save. - Optional: under Connection > Data, fill Auto-login username with
rootso you are not asked for it. - Go back to Session, select
myvps, click Save again, then Open.
On the first connection PuTTY shows a PuTTY Security Alert with the server key fingerprint. Click Accept only if you trust the server: the key is then remembered in the registry.
⏱️ Prevent disconnections with keepalive
Idle sessions are often dropped by routers and firewalls. Open Connection, set Seconds between keepalives to 30, then return to Session and save myvps again. PuTTY will then send a small packet every 30 seconds.
🔑 Generate a key pair with PuTTYgen
Open PuTTYgen, choose EdDSA (Ed25519) as the key type, and click Generate, moving the mouse over the blank area. Then:
- Enter a Key passphrase and confirm it.
- Click Save private key and keep the
.ppkfile somewhere safe. - Copy the text from Public key for pasting into OpenSSH authorized_keys file.
Log in with your password, then install the public key on the VPS (replace the placeholder text with the line you copied):
Bashmkdir -p ~/.ssh && chmod 700 ~/.ssh nano ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
In PuTTY, go to Connection > SSH > Auth > Credentials, pick your .ppk under Private key file for authentication, go back to Session and save. To reuse an existing OpenSSH private key, use PuTTYgen: Conversions > Import key, then Save private key.
🧩 Load the key once with Pageant
Pageant is the PuTTY key agent. Start pageant.exe, which sits in the notification area, right-click its icon, choose Add Key, select the .ppk and type the passphrase once. While Pageant is running, PuTTY and pscp use the key without asking again. Close Pageant to forget the key.
📂 Transfer files with pscp
pscp.exe is PuTTY's command-line copy tool. Note the uppercase -P for the port. From PowerShell:
PowerShell# Upload a file pscp -P 22 C:\Users\USER\Documents\site.zip root@VPS_IP:/root/ # Download a file pscp -P 22 root@VPS_IP:/var/log/syslog C:\Users\USER\Downloads\ # Upload a whole folder pscp -r -P 22 C:\Users\USER\project root@VPS_IP:/root/ # Use a specific key pscp -i C:\keys\vps.ppk site.zip root@VPS_IP:/root/
If pscp is not found, call it with its full path, for example & 'C:\Program Files\PuTTY\pscp.exe'.
✅ Verify the connection
Once logged in, check that key login is used and that the machine is the right one:
Bashwhoami hostname cat /etc/os-release sudo grep 'Accepted publickey' /var/log/auth.log | tail -n 3
The last command works on Ubuntu/Debian; on AlmaLinux/Rocky, use sudo journalctl -u sshd | grep Accepted | tail -n 3. The PuTTY title bar shows the connected session, and the Event Log (right-click the title bar) lists the authentication steps.
🛠️ Troubleshooting
Network error: Connection timed out / refused. Check VPS_IP and the port, that the VPS is started, and that SSH listens (sudo systemctl status ssh on Ubuntu/Debian, sshd on AlmaLinux/Rocky). A local firewall or a corporate network may also block the port.
Server refused our key / Disconnected: No supported authentication methods available. The public key was not pasted on a single line, the wrong user is used, or permissions are too open. Re-check authorized_keys, run chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys, and confirm the .ppk matches the public key.
Unable to use key file (OpenSSH SSH-2 private key). PuTTY cannot read that format. Convert the key with PuTTYgen (Conversions > Import key), or update PuTTY to a current release.
Session freezes after a few minutes. Set the keepalive interval described above.
🚀 PuTTY is now set up with a saved session, key login and file transfer. Next step: disable password login once your key works.