Servers & VPS

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

Step-by-step guide to connecting to your VPS via SSH from Windows or Mac, with or without a password.

Close-up image of ethernet cables plugged into a network switch, showcasing IT infrastructure.

To connect to your VPS server via SSH, all you need is the command ssh user@server_IP from your terminal. On Mac and Linux it's available out of the box; on Windows 10/11 it's built in as well.

SSH (Secure Shell) is the standard protocol for managing Linux servers remotely. All communication is encrypted, making it safe to use even on public networks. This guide walks you through connecting step by step from Windows or Mac, and setting up SSH keys so you never have to type a password again.

What You Need Before You Start

Before you open a terminal, gather these three pieces of information. You'll find them in the welcome email from your VPS provider or in your control panel:

  • Server IP address (e.g., 203.0.113.45)
  • Username (usually root on first login)
  • Password or SSH key provided by the host
  • SSH port (default is 22; some providers use a different one)

If your provider already installed your public key when creating the server, you won't need a password. In that case, skip directly to the SSH keys section below.

Connecting via SSH from Mac or Linux

Open the Terminal app (on Mac: Finder → Utilities → Terminal, or search "Terminal" in Spotlight) and type:

ssh [email protected]

Replace root with your username and 203.0.113.45 with your actual VPS IP.

The first time you connect, you'll see a prompt like this:

The authenticity of host '203.0.113.45' can't be established.
ECDSA key fingerprint is SHA256:abc123...
Are you sure you want to continue connecting (yes/no)?

Type yes and press Enter. Your machine will save the server's fingerprint for future connections. Then enter your password when prompted — you won't see the characters as you type; that's normal.

If your provider uses a non-standard port, add the -p flag:

ssh -p 2222 [email protected]

Connecting via SSH from Windows

Windows 10 (version 1809 and later) and Windows 11 include a native SSH client. Open PowerShell or Command Prompt and use the exact same command:

ssh [email protected]

The flow is identical to Mac: accept the host fingerprint and enter your password.

Alternative: PuTTY

If you prefer a graphical interface or are on Windows 7/8, download PuTTY from its official website. Setup is straightforward:

  1. Enter your VPS IP in the Host Name field.
  2. Leave the port at 22 (or change it if needed).
  3. Click Open.
  4. Accept the server fingerprint in the pop-up window.
  5. Enter your username and password in the terminal that appears.

PuTTY also lets you save connection profiles so you don't have to type the IP every time.

SSH Key Authentication (No Password Required)

SSH keys are more secure than passwords and more convenient once set up. They rely on a key pair: the private key (stored on your machine) and the public key (stored on the server).

Step 1: Generate the key pair

In your terminal (Mac, Linux, or PowerShell on Windows):

ssh-keygen -t ed25519 -C "my-vps"

Press Enter to accept the default path (~/.ssh/id_ed25519). You can add a passphrase for extra security.

Step 2: Copy the public key to the server

From Mac or Linux:

ssh-copy-id [email protected]

From Windows PowerShell, the manual equivalent is:

type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Step 3: Test the passwordless connection

ssh [email protected]

If you get in without a password prompt, the setup worked.

Troubleshooting Common SSH Errors

Error Likely cause Fix
Connection refused SSH not running or wrong port Check the port in your VPS control panel
Connection timed out Firewall blocking port 22 Open the port in your provider's firewall rules
Permission denied (publickey) Public key not on the server Repeat step 2 or connect with a password first
Host key verification failed Server IP has changed Remove the old entry from ~/.ssh/known_hosts

If your provider offers a network-level firewall in their control panel (separate from the OS firewall), make sure port 22 is allowed there too.

For more guides on managing your server, explore the articles in our VPS servers section.

Key takeaways

  • SSH connection is as simple as ssh user@IP from any modern terminal.
  • Mac and Linux have SSH built in; Windows 10/11 does too, natively.
  • PuTTY remains a solid graphical alternative for Windows users.
  • Ed25519 SSH keys are more secure than passwords and eliminate brute-force risk.
  • Most connection errors trace back to firewall rules or a non-standard SSH port.

Ready to take full control of your server? The team at elenlace.com can set up and manage your VPS so you can focus on your business, not your infrastructure.

FAQ

Which user should I use to SSH into my VPS?

Most providers create a root user for initial access. For security, once you're in you should create a regular user with sudo privileges and disable direct root SSH login in the /etc/ssh/sshd_config file.

Do I need to install anything on Windows to use SSH?

No, not if you're on Windows 10 (version 1809 or later) or Windows 11. OpenSSH is built in — just open PowerShell or CMD and run the ssh command. On older Windows versions, install PuTTY or enable the optional OpenSSH component from system settings.

Can I SSH into my VPS if it's down?

No. SSH requires the server to be up and the SSH daemon to be running. If the server is unresponsive, use the emergency console (KVM/VNC) in your provider's control panel to get in without a network connection.

How do I know my SSH connection is secure?

SSH encrypts the entire session using modern ciphers (ChaCha20, AES-GCM). The fingerprint you accept on first connection ensures you're talking to the real server and not an attacker. For maximum security, disable password authentication entirely and rely only on SSH keys.

Prefer it done for you? El Enlace handles hosting and professional web development.

Useful resources

Other providers and guides worth comparing:

← All