How to Connect to a Linux VPS with PuTTY
Connect to a Linux server from Windows with PuTTY: download it safely, enter the address, accept the host key, log in, save the session, add a key.
4 min readBy Swati
Reviewed by the AmazingRDP technical team

Need a server to connect to? A Linux VPS gives you root access over SSH. See Linux VPS from $6.99
PuTTY is a small, free program that opens an SSH session from Windows to a Linux server. You type commands on your PC; they run on the server. Windows now has an SSH client built in, and the comparison of SSH clients explains when that is enough. PuTTY remains popular because it saves sessions with all their settings and runs on any Windows version. Here is the whole path from download to a saved, key-based login.
What you need
- The server's IP address.
- The user name, usually
rooton a new VPS. - The password.
- The SSH port, 22 unless your provider says otherwise.
All four are in the email you received when the server was set up, and in the client area.
Step 1: download PuTTY from its own site
PuTTY's home is on its author's site at chiark.greenend.org.uk; searching for "PuTTY" also turns up advertising pages that have carried tampered copies. Take the 64-bit installer (.msi), which also installs the companion tools PuTTYgen and Pageant. It is in the Microsoft Store as well.
Step 2: enter the connection details
- Start PuTTY. The Session page opens.
- Host Name (or IP address): the server's address.
- Port: 22, or the one you were given.
- Connection type: SSH.
- Click Open.
Step 3: accept the host key
At the first connection PuTTY shows a security alert with the server's key fingerprint. This is expected: PuTTY has never seen this server. Click Accept to remember the key.
If the alert appears again later for the same server, with the words "potential security breach", PuTTY is telling you the server's key has changed. After a reinstallation of the server that is normal. Otherwise, do not continue until you know why.
Step 4: log in
- At
login as:type the user name and press Enter. - Type the password and press Enter. Nothing appears while you type, not even dots. That is normal.
To paste a password, click the right mouse button once in the window. You are in when you see a prompt such as root@server:~#.
Step 5: save the session
So that you need not type the address again:
- Fill in the Session page as in step 2.
- Under Connection, Data, enter the user name in Auto-login username.
- Under Connection, set Seconds between keepalives to 30, so that idle sessions are not dropped.
- Back on Session, type a name under Saved Sessions and click Save.
Next time, double-click the name. PuTTY does not store passwords, which is a good thing.
Copy and paste in PuTTY
| To | Do |
|---|---|
| Copy from the window | Select the text with the mouse; it is copied at once |
| Paste into the window | Right-click, or Shift + Insert |
| Stop a running command | Ctrl + C (which does not copy here) |
| End the session | Type exit |
First commands on a new server
passwd
apt update && apt upgrade
The first changes the password you were sent. The second installs updates on Ubuntu and Debian (dnf upgrade on the Red Hat family).
Step 6: log in with a key
A key is safer than a password and saves typing.
- Start PuTTYgen, choose EdDSA (Ed25519), click Generate and move the mouse.
- Enter a passphrase and click Save private key. Keep the
.ppkfile to yourself. - Copy the text in the box Public key for pasting into OpenSSH authorized_keys file.
- On the server, in your PuTTY session:
mkdir -p ~/.ssh && chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
Paste the key as a single line, save and close.
- In PuTTY, load your saved session, go to Connection, SSH, Auth, Credentials, and choose the
.ppkfile as the private key. Save the session again. - Connect. PuTTY asks for the key's passphrase in place of the server password.
Test the key login in a second window before changing anything else. More detail, with pictures, in generating an SSH key in Windows; switching password logins off is in SSH hardening.
Problems
| Message | Cause |
|---|---|
| Network error: Connection timed out | Wrong address or port, a firewall in between, or the server is off. Check it in the control panel |
| Network error: Connection refused | The server is reachable, but nothing listens on that port: wrong port, or the SSH service is stopped. See the SSH port |
| Access denied | Wrong user name or password, or password login is switched off |
| Server refused our key | The public key is not in authorized_keys, was pasted over several lines, or the file's permissions are too open |
| Software caused connection abort | The connection was idle or interrupted. Set keepalives (step 5) |
| Strange characters in menus | Under Window, Translation, set the character set to UTF-8 |
Moving files
PuTTY is a terminal only. For files, use WinSCP, which can import your PuTTY sessions, or the command-line tool pscp that is installed with PuTTY. From a Mac the built-in terminal does the same job: see SSH on a Mac. For a server to practise on, see our Linux VPS plans.
Questions
How do I connect to a Linux VPS with PuTTY?
Enter the server's IP address and port 22 in PuTTY, click Open, accept the host key, then type the user name and password.
Why can I not see my password when typing in PuTTY?
SSH never shows the password, not even as dots. Type it and press Enter.
How do I paste in PuTTY?
Right-click in the window, or press Shift + Insert.
What does "Connection refused" mean in PuTTY?
The server answered, but no SSH service is listening on that port. Check the port number and that the service is running.