SSH (Secure Shell) is the standard protocol for securely connecting to remote Linux servers. This guide covers connecting from macOS, Linux, and Windows.
Prerequisites
- A running LightYear server with a public IP address
- An SSH key pair added to the server during deployment (or root password if no key was added)
Connect from macOS or Linux
Open your terminal and run:
$ssh root@YOUR_SERVER_IPIf you use a non-default key file location, specify it with the -i flag:
$ssh -i ~/.ssh/my_custom_key root@YOUR_SERVER_IPOn first connection you will see a host key fingerprint prompt:
The authenticity of host '45.77.x.x (45.77.x.x)' can't be established.
ED25519 key fingerprint is SHA256:abc123xyz...
Are you sure you want to continue connecting (yes/no/[fingerprint])?Type yes and press Enter. The fingerprint is saved to ~/.ssh/known_hosts for future connections.
Connect from Windows
Option A — Windows Terminal / PowerShell (Recommended)
Windows 10 1809+ and Windows 11 include a built-in OpenSSH client. Open Windows Terminal or PowerShell and run:
$ssh root@YOUR_SERVER_IPOption B — PuTTY
- Download PuTTY and open it.
- Enter your server IP in the Host Name field.
- Set Port to
22and Connection type toSSH. - Under Connection → SSH → Auth → Credentials, browse to your
.ppkprivate key file. - Click Open.
[!TIP] To convert an OpenSSH key (
id_ed25519) to PuTTY format (.ppk), use PuTTYgen: File → Load Private Key → Save Private Key.
Create an SSH Config File for Convenience
Instead of typing the full command every time, add an entry to ~/.ssh/config:
Host myserver
HostName 45.77.x.x
User root
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 60Now you can connect with just:
$ssh myserverTroubleshooting Connection Issues
| Error | Likely Cause | Fix |
|---|---|---|
Connection refused | SSH daemon not running or port blocked | Check firewall rules allow port 22 |
Permission denied (publickey) | Wrong key or key not added to server | Verify key in ~/.ssh/authorized_keys |
Host key verification failed | Server IP changed or re-deployed | Run ssh-keygen -R YOUR_SERVER_IP |
Connection timed out | Network/firewall blocking port 22 | Check LightYear firewall group rules |
[!WARNING] If you see
Host key verification failed, do not bypass it blindly. Verify the server IP is correct before removing the old host key entry.
