Connect to your VPS with SSH
SSH (Secure Shell) gives you a secure command line on a remote server. Every server admin uses it, and the first login is simpler than it looks. This guide covers connecting from macOS, Linux and Windows.
Before you begin
- Your server's IP address, shown in your LightServe control panel. This guide uses 203.0.113.10 as an example.
- The login details for the first connection: usually the
rootuser and the password or SSH key provided when the server was created. - A terminal on your computer. macOS and Linux include an SSH client. Windows 10 and 11 include one too, through PowerShell.
Step 1: Open a terminal and check for SSH
On macOS, open the Terminal app. On Linux, open your terminal emulator. On Windows, open PowerShell from the Start menu. Then confirm that the SSH client is installed:
ssh -V
The ssh -V command prints the client version. Any output that begins with OpenSSH means you are ready. If Windows says ssh is not recognized, turn on the OpenSSH Client under Optional features in Windows Settings.
OpenSSH_9.6p1, OpenSSL 3.0.13
Step 2: Connect to the server
The general form is ssh username@address. The username is the account you want to log in as, and the address is your server's IP. For the first login, use root:
ssh root@203.0.113.10
The first time you connect, SSH shows the server's fingerprint and asks you to confirm it. Type yes and press Enter. SSH saves the fingerprint so it can warn you later if the server ever changes unexpectedly:
The authenticity of host '203.0.113.10 (203.0.113.10)' can't be established.
ED25519 key fingerprint is SHA256:Qx3...example...
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '203.0.113.10' (ED25519) to the list of known hosts.
root@203.0.113.10's password:
Type the password and press Enter. Nothing appears on screen while you type, which is normal. If you were given an SSH key instead, SSH uses it automatically.
Step 3: Confirm where you are
Once you are logged in, the prompt changes to show the server. Run these commands to confirm the server name, the account and the operating system:
hostname
whoami
lsb_release -a
hostname prints the server name, whoami prints the account you are using, and lsb_release -a shows the Ubuntu release. You should see Ubuntu 24.04 LTS.
web1
root
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble
Step 4: Leave the session and save a shortcut
Type exit and press Enter to close the connection. To avoid typing the address each time, add a short entry to a file called config in the .ssh folder on your own computer:
mkdir -p ~/.ssh
nano ~/.ssh/config
Add these lines, then save and close the file. The mkdir command creates the folder if it does not exist, and nano is a simple text editor.
Host myserver
HostName 203.0.113.10
User root
Now ssh myserver connects you directly.
root. Root can change or delete anything on the system, so a mistake can be costly.Troubleshooting
- Connection timed out. Check the IP address for typos and make sure the server has finished starting. If it still fails, a firewall may be blocking port 22. The firewall guide explains how to check.
- Permission denied. The username or password is wrong. Confirm the account name and try again, or use the credentials from your control panel.
- REMOTE HOST IDENTIFICATION HAS CHANGED. This usually means you reinstalled the server, so its fingerprint changed. Only if you know the cause, remove the old entry with
ssh-keygen -R 203.0.113.10and connect again. - ssh is not recognized on Windows. Enable the OpenSSH Client feature as described in Step 1.
Next steps
You are in. Next, create a regular user account so you can stop working as root, then set up SSH keys so you do not need a password every time.
Something not working? Chat or email our support team and we will help you get unstuck.
Contact support