How do I connect to my VPS via SSH?

VPS 2 min read

The VPS is managed via SSH (Secure Shell): this establishes an encrypted connection between your own computer and the server, on which you can run commands. You can read more about how SSH works.

What will you need?

  • The VPS’s IP address. You will receive this, along with your initial login details, by email once the server is ready, and you will also find them on the service page in the client portal.
  • The username (usually root on first login).
  • Either a password or an SSH key pair.

Connecting from Linux or macOS

Open a terminal and enter the following (replacing the IP address with your own):

ssh root@203.0.113.25

If SSH is not running on port 22, specify the port: ssh -p 2222 root@203.0.113.25.

When connecting for the first time, the program will ask if you trust the server’s fingerprint (Are you sure you want to continue connecting?). Enter yes. It will then ask for your password; nothing will appear on the screen whilst you are typing, which is normal.

Connecting from Windows

Windows 10 and 11 come with the OpenSSH client pre-installed, so the same ssh command works in PowerShell or Windows Terminal. PuTTY, for example, offers a graphical interface: enter the IP address in the ‘Host Name’ field, the port number in the ‘Port’ field (22 by default), then click the ‘Open’ button.

First steps after logging in

  1. Update the system; see the article on system updates using dnf and apt.
  2. Create a user account with sudo privileges so that you do not have to work as root; the steps are outlined in the article on creating a user with sudo privileges.
  3. Set up password-protected access (below), then configure a firewall.

Using an SSH key instead of a password

Key-based login is both more secure and more convenient. Create a key pair on your own computer:

ssh-keygen -t ed25519 -C "laptop"

Then copy the public key to the server:

ssh-copy-id felhasznalo@203.0.113.25

On Windows, where ssh-copy-id is not available, in PowerShell:

type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh felhasznalo@203.0.113.25 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

If key-based authentication is working, you can also disable password-based authentication; this is covered in the article on securing your SSH server.

Common errors

  • Connection timed out: the IP address is incorrect, or the firewall is blocking the port.
  • Connection refused: the server is accessible, but SSH is not running on that port; please check the port number.
  • Permission denied: the username, password or key is incorrect, or password-based access is disabled.
  • REMOTE HOST IDENTIFICATION HAS CHANGED: the server’s fingerprint has changed, for example following a VPS reinstallation. If you are certain this is the cause, delete the old entry: ssh-keygen -R 203.0.113.25. If you have not reinstalled the server, please contact us before proceeding.

This article explains how to copy files via SSH using scp, rsync and sftp.

Back: VPS articles (12)