SSH (Secure Shell) is how you manage a Linux VPS: an encrypted command-line connection to your server. After ordering a VPS you receive an IP address, a username (usually root) and a password. That’s everything you need to connect from Windows, macOS or Linux.

What you need

Item Example
Server IP 203.0.113.10
Username root
Password or private key From your welcome email / control panel
Port 22 (default)

Connect from Windows 10/11 (built-in)

Windows includes an OpenSSH client. Open Windows Terminal, PowerShell or Command Prompt:

ssh [email protected]

On the first connection you see the server’s fingerprint:

The authenticity of host '203.0.113.10' can't be established.
ED25519 key fingerprint is SHA256:abc123…
Are you sure you want to continue connecting (yes/no)?

Type yes, then enter the password. Nothing appears as you type it; that’s normal. You’re in when you see a prompt like root@server:~#.

If ssh isn’t recognized, enable it in Settings → System → Optional features → OpenSSH Client.

Connect with PuTTY (Windows)

  1. Install PuTTY from the official site.
  2. Host Name: 203.0.113.10, Port: 22, Connection type: SSH.
  3. Optionally save the session with a name.
  4. Click Open, accept the host key, and log in as root.

Right-click pastes into PuTTY. Selecting text copies it.

Connect from macOS and Linux

Open Terminal:

ssh [email protected]
ssh -p 2222 [email protected]        # if SSH runs on another port

First things to do after logging in

passwd                                  # change the root password
apt update && apt upgrade -y            # Ubuntu/Debian (dnf upgrade on AlmaLinux/CentOS Stream)
adduser deploy                          # create a regular user
usermod -aG sudo deploy                 # give it sudo (group "wheel" on RHEL family)

Then set up SSH keys and a firewall. See Ubuntu 24.04 initial server setup.

Keys are more secure than passwords, and you won’t have to type a password each time.

  1. Create a key pair on your computer (Windows PowerShell, macOS or Linux):
ssh-keygen -t ed25519 -C "you@laptop"

Press Enter to accept the default location. Adding a passphrase is recommended.

  1. Copy the public key to the server:
ssh-copy-id [email protected]            # macOS / Linux

On Windows (no ssh-copy-id):

type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys"
  1. Log in with the key: ssh [email protected].

  2. Once key login works, consider disabling password logins and root login in /etc/ssh/sshd_config. See SSH keys with ssh-keygen and disabling root SSH login.

Save time with an SSH config file

Create ~/.ssh/config (on Windows: C:\Users\you\.ssh\config):

Host myvps
    HostName 203.0.113.10
    User deploy
    Port 22
    IdentityFile ~/.ssh/id_ed25519

Now just type ssh myvps. See the SSH config file.

Copy files

scp backup.tar.gz myvps:/home/deploy/
scp myvps:/var/log/nginx/error.log .

Or use SFTP with a GUI client like FileZilla or WinSCP. See the scp command and setting up an SFTP server.

Common errors

Error Cause / fix
Connection timed out Wrong IP, server down, or firewall blocking port 22. Check in the control panel; use the VNC console
Connection refused SSH not running or on another port. See SSH connection refused
Permission denied (publickey,password) Wrong password or user; key not installed; password login disabled
REMOTE HOST IDENTIFICATION HAS CHANGED Server was reinstalled (new host key). If expected: ssh-keygen -R 203.0.113.10
Session drops when idle Add ServerAliveInterval 60 to ~/.ssh/config

If you’re locked out completely (for example after a firewall mistake), the VNC console in your VPS control panel gives you direct access to fix it.

Quick reference

Task Command
Connect ssh user@ip
Other port ssh -p 2222 user@ip
Create key ssh-keygen -t ed25519
Install key ssh-copy-id user@ip
Shortcut ~/.ssh/config → ssh myvps
Remove old host key ssh-keygen -R ip

Related: what is a VPS and VPS root access.

  • SSH
  • VPS
  • Beginners