How to Connect to Your VPS via SSH (Windows, macOS & Linux)

SSH (Secure Shell) is the standard way to remotely access and manage a Linux VPS. This guide covers connecting from Windows, macOS, and Linux, using both passwords and SSH keys, plus troubleshooting for the most common connection problems.

What You Need Before Connecting

  • Your VPS IP address
  • Your SSH username (often root initially)
  • Your SSH password, or a private key file
  • The SSH port (default is 22 unless changed)

Connecting from Windows

Modern Windows includes an OpenSSH client built into PowerShell and Windows Terminal — no extra software required.

ssh root@YOUR_SERVER_IP

If your VPS uses a custom SSH port:

ssh -p 2222 root@YOUR_SERVER_IP

On first connection, you'll be asked to confirm the server's fingerprint — type yes if the IP matches your VPS.

Connecting from macOS or Linux

Open Terminal and use the same command:

ssh root@YOUR_SERVER_IP

Connecting with an SSH Key (Recommended)

If you've configured key-based authentication:

ssh -i /path/to/private_key root@YOUR_SERVER_IP

Never share your private key file with anyone.

Verifying You're Connected

whoami
hostname
uname -a

Copying Files with SCP

scp file.txt root@YOUR_SERVER_IP:/home/username/

Common Connection Problems

Connection timed out — the VPS may be unreachable, or the SSH port is blocked by a firewall. Verify the IP and port shown in your VPS For Life Client Area.

Connection refused — the SSH service may not be running, or you're using the wrong port:

sudo systemctl status ssh

Permission denied (publickey,password) — check your username, password, or key path. If password login is disabled, you must use the correct SSH key.

Wrong SSH port — specify it explicitly with -p:

ssh -p PORT username@SERVER_IP

Recommended Next Steps After First Login

  • Create a dedicated sudo user instead of using root for daily work
  • Set up SSH key authentication
  • Change the default SSH port and disable root login
  • Enable a firewall

FAQ

Do I need special software on Windows?
No — Windows 10/11 include OpenSSH by default in PowerShell and Windows Terminal. Third-party tools like PuTTY are optional alternatives.

Is it safe to type "yes" to accept the server fingerprint?
Yes, on first connection to a server you know is yours. If the warning reappears on a server you've connected to before, verify with VPS For Life support before proceeding, as it can indicate a changed host key.

New to VPS For Life? If you haven't ordered your VPS yet, browse our VPS hosting plans to get started, or contact our support team if you need help choosing the right one.

Continue Reading

Browse more articles in Getting Started / VPS Basics.

  • ssh, connect to vps, putty, terminal, vps basics
  • 0 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

How to Create a New User with Sudo Access on a Linux VPS

Using the root account for everyday administration is risky — a single mistyped command can...

How to Check VPS Resource Usage (CPU, RAM & Disk)

Monitoring your VPS's resource usage helps you catch performance problems before they cause...

How to Reboot a Linux VPS Safely

Rebooting is sometimes required — after a kernel update, to apply certain configuration...

VPS Terminology: A Beginner's Glossary

New to VPS hosting? This glossary explains the most common terms you'll encounter while setting...

How to Choose the Right VPS Plan for Your Workload

Picking the wrong VPS size is one of the most common beginner mistakes — too small and your...