How to Connect to a Server via SSH — Windows, macOS, Linux

05 Mar 2026 By Edgars Kalējs

To connect to a server over SSH you need three things: the IP address, a username and a password (or an SSH key). The basic command is the same on macOS, Linux and modern Windows:

ssh user@YOUR_IP

Below is how to do it on each operating system.

Linux and macOS

The SSH client is already built into the terminal. Open a terminal and run:

On the first connection the system asks you to confirm the server key — type yes. Then enter the password (the characters are not shown, and that is normal).

If SSH runs on a non-standard port, pass it with the -p flag:

ssh -p 2222 [email protected]

Windows 10 and 11: the built-in client

Modern Windows versions already include an SSH client. Open PowerShell or Command Prompt and type the same command:

ssh root@203.0.113.10

Everything works exactly as it does on Linux. This is the simplest way — no third-party software needed.

Windows: PuTTY

If you prefer a graphical client, use PuTTY:

  1. Download PuTTY from the official site and run it.
  2. Enter the server IP address in the Host Name field.
  3. Enter the port in the Port field (22 by default).
  4. Make sure the connection type is set to SSH.
  5. Click Open.
  6. In the window that opens, enter the username and password.

On the first connection PuTTY shows a key fingerprint warning — click Accept.

Comparison of the options

OS Client Command / action
Linux Terminal ssh user@ip
macOS Terminal ssh user@ip
Windows 10/11 PowerShell ssh user@ip
Windows (GUI) PuTTY Host + Port + Open

Connecting with an SSH key

If you have set up key-based login, point to the private key with the -i flag:

ssh -i ~/.ssh/id_ed25519 [email protected]

In PuTTY the key is attached under Connection → SSH → Auth → Credentials (the .ppk format, converted with PuTTYgen).

Common errors and fixes

Connection timed out. The server is unreachable: check the IP, whether the server is powered on and whether a firewall blocks the port. To check reachability:

ping 203.0.113.10

Connection refused. The port is closed or the SSH service is not running. Make sure the port is correct and that sshd is running on the server.

Permission denied. Wrong login, password or key. Check the username and your keyboard layout.

Host key verification failed. The server key changed (for example after the OS was reinstalled). Remove the old entry:

ssh-keygen -R 203.0.113.10

Frequently asked questions

Which port does SSH use by default? Port 22. If the administrator changed it, connect with the -p flag and the right number.

Do I need to install PuTTY on Windows 11? No. The built-in client in PowerShell is enough. PuTTY is useful if you want a graphical interface or work with .ppk keys.

How do I connect if I forgot the root password? Use the KVM console in the server control panel — it gives you hardware-level access and lets you reset the password in recovery mode.

Can I log in directly as a regular user? Yes, use their name instead of root: ssh deploy@YOUR_IP. That is the safer option.

Summary

SSH is the standard way to manage a server. On macOS, Linux and Windows 10/11 a single ssh user@ip command is enough, and PuTTY covers those who prefer a GUI. The next step is to set up key-based login and disable the password.

Need a server to practise on? Choose a Linux VPS, order VPS hosting, or get Server administration.

Edgars Kalējs