How to Log In to Your VPS

A VPS is accessed over SSH rather than through a control panel. Your provider will have sent you an IP address, a username and either a password or an SSH key.

From macOS or Linux

Open Terminal and run:

ssh root@your.server.ip.address

The first time you connect you will be asked to confirm the server's fingerprint. Type yes to continue.

From Windows

Windows 10 and later include SSH, so the same command works in PowerShell. Alternatively use PuTTY: enter the IP address, leave the port at 22, and click Open.

Using an SSH key

If you were given a key file rather than a password:

chmod 600 /path/to/your-key.pem
ssh -i /path/to/your-key.pem root@your.server.ip.address

SSH refuses to use a key file that others can read, which is why the chmod step is necessary.

First things to do

  1. Change the root password with passwd.
  2. Create a normal user and use it for day-to-day work instead of root.
  3. Install updatesapt update && apt upgrade on Debian or Ubuntu, dnf update on RHEL-based systems.
  4. Set up key-based login and disable password authentication once keys are working.

If you cannot connect

  • Connection refused — SSH is not running, or is on a non-standard port. Add -p PORT.
  • Connection timed out — a firewall is blocking port 22, or the IP address is wrong.
  • Permission denied — wrong username, password or key. Many images use ubuntu or admin rather than root.
Was this article helpful?