Servers & VPS

How to Connect to Your VPS via SSH from Windows or Mac

Learn step by step how to establish a secure SSH connection to your VPS from Windows using PuTTY or the native terminal, and from Mac using the built-in terminal.

Numerous wires and cables mounted into server patch panel in modern data center

To connect to your VPS via SSH from Windows, open PowerShell or Command Prompt and type ssh user@YOUR_VPS_IP. On Mac, open Terminal and use the same command. You'll have full remote access to your server in seconds.

SSH (Secure Shell) is the standard protocol for managing Linux servers remotely. All communication is encrypted, making it safe even on public networks. This guide walks you through the process from scratch — whether you're on Windows 10/11 or macOS — so you can start your first session in minutes.

What You Need Before You Start

Before opening any terminal, make sure you have:

  • VPS IP address — found in your hosting provider's control panel.
  • Username — usually root on Linux, though some providers create a separate user for security.
  • Password or SSH private key — typically included in your provider's welcome email.
  • SSH port — the default is 22; note it if your VPS uses a different one.

If you haven't chosen a VPS yet, check our VPS servers guide for comparisons and recommendations to pick the right plan.

Connecting from Windows

Windows 10 (build 1809 and later) and Windows 11 include a native OpenSSH client, so no extra software is required.

Option A — Native Terminal (recommended)

  1. Press Win + R, type cmd or powershell, and hit Enter.
  2. Type the connection command:
    ssh [email protected]
    Replace root with your username and 203.0.113.10 with your actual VPS IP.
  3. On your first connection, you'll see "The authenticity of host can't be established." Type yes and press Enter to accept the server fingerprint.
  4. Enter your password when prompted (the cursor won't move as you type — that's normal).

Option B — PuTTY (classic GUI client)

PuTTY remains useful if you prefer a graphical interface or are on Windows 7/8.

  1. Download PuTTY from putty.org and install it.
  2. Open PuTTY. In the Host Name field, enter your VPS IP; leave Port as 22.
  3. Click Open. Accept the security alert on your first connection.
  4. Type your username and password in the terminal window that appears.

Connecting from Mac

macOS ships with OpenSSH built in. No installation needed.

  1. Open Terminal (search with Cmd + Space → "Terminal").
  2. Run:
    ssh [email protected]
  3. Accept the server fingerprint by typing yes.
  4. Enter your password. Done.

If your provider gave you a private key file (.pem or .key) instead of a password, use the -i flag:

ssh -i ~/Downloads/my_key.pem [email protected]

If the file permissions are too open, the SSH client will reject it. Fix that with:

chmod 400 ~/Downloads/my_key.pem

Using SSH Keys Instead of Passwords (More Secure)

SSH keys eliminate brute-force risks against your password. The following steps work the same on Windows (PowerShell) and Mac (Terminal).

  1. Generate a key pair on your local machine:
    ssh-keygen -t ed25519 -C "my-vps"
    Press Enter three times to accept the default path and leave the passphrase empty (or add one for an extra layer of protection).
  2. Copy the public key to your VPS:
    ssh-copy-id [email protected]
    On Windows without ssh-copy-id, manually paste the contents of ~/.ssh/id_ed25519.pub into ~/.ssh/authorized_keys on the server.
  3. From now on, ssh [email protected] will connect without asking for a password.

Common Errors and How to Fix Them

Error Likely cause Fix
Connection refused SSH not running or wrong port Check the port in your VPS panel; add -p PORT to the command
Permission denied (publickey) Key not in authorized_keys Re-run ssh-copy-id or paste the key manually
Host key verification failed Server fingerprint changed (e.g. after reinstall) Remove old entry: ssh-keygen -R VPS_IP
Network timeout VPS firewall blocking port 22 Open the port in your panel firewall or via ufw allow 22

If errors persist, the server specialists at elenlace.com can diagnose the problem for you in minutes.

Key Takeaways

  • Windows 10/11 and macOS both include a native SSH client — no extra software needed.
  • The basic command is always ssh user@IP; add -p PORT if your port differs from 22.
  • PuTTY remains a solid option for those who prefer a GUI on Windows.
  • SSH keys (ed25519) are more secure than passwords and eliminate brute-force risk.
  • Most connection errors stem from the wrong port, an active firewall, or incorrect key permissions.

Ready to manage your server with confidence? Reach out to the team at elenlace.com and we'll help you set up your VPS from scratch, including secure SSH access and initial hardening.

FAQ

Can I connect via SSH if I forgot my password?

Yes, but you'll need access to your provider's rescue console (VNC or KVM console) to reset the root user password or update the authorized public key.

Is SSH safe on public Wi-Fi?

Yes. SSH encrypts all traffic end-to-end, so an attacker on the same network cannot read your commands or credentials. That said, always use SSH keys instead of passwords for maximum protection.

How do I change the SSH port for better security?

Edit /etc/ssh/sshd_config on your VPS, change Port 22 to your chosen number (e.g. Port 2222), restart the SSH service, and open the new port in your firewall — all before closing your current session.

Can I manage multiple VPS servers with different SSH keys?

Absolutely. Create a ~/.ssh/config file on your local machine with one entry per server, specifying the host, user, port, and path to the private key. Then simply run ssh alias-name instead of the full command.

Further reading

Other providers and guides worth comparing:

← All