All Servers & Email 10% Off!limitsiz10
Servers

How to Connect to a Server via SSH: Windows, macOS and Linux Guide

The easiest ways to connect to your VDS or VPS server via SSH: step-by-step commands for Windows (PowerShell and PuTTY), macOS and Linux, creating an SSH key, common errors and basic security settings.

Limitsiz BulutLimitsiz Bulut Support TeamTechnical support and systems engineers Published 4 min read

You've just got a new VDS or VPS server along with an IP address, a username and a password. What's next? The standard way to manage Linux servers is an SSH connection. In this guide we explain how to connect to a server via SSH on Windows, macOS and Linux step by step, and cover creating an SSH key for passwordless, secure login, common errors and basic security settings.

What Is SSH?

SSH (Secure Shell) is a protocol that gives you command-line access to a remote server over an encrypted connection. The SSH client on your computer (the ssh command or PuTTY) talks to the SSH server (sshd) that runs continuously on the server. Because passwords, commands and files are encrypted in transit, third parties can't read them. That's why SSH has completely replaced the old, unencrypted Telnet protocol.

By default SSH uses TCP port 22. Almost all Linux-based VDS and VPS servers come with the OpenSSH server installed and enabled.

What You Need Before Connecting

  • Server IP address: For example 203.0.113.10. You'll find it in your server delivery email or customer panel.
  • Username: Usually root; on some distributions a user such as ubuntu, debian or almalinux.
  • Password or SSH key: A password is usually provided at initial setup.
  • SSH port: 22 unless it has been changed.

Connecting to a Server via SSH from Windows

Method 1: Built-in OpenSSH client (PowerShell or Command Prompt)

Windows 10 and Windows 11 ship with a built-in OpenSSH client, so you don't need to install anything. Open PowerShell or Command Prompt from the Start menu and type:

ssh [email protected]

On the first connection, the server's fingerprint is displayed and you're asked whether you want to continue. Type yes, press Enter and then enter your password. It's normal that no characters appear on screen while you type the password.

If your server uses a different port, add the -p parameter:

ssh -p 2222 [email protected]

If you get an "ssh is not recognized" error, add "OpenSSH Client" under Settings › System › Optional features.

Method 2: Connecting with PuTTY

If you prefer a graphical interface, you can use the free PuTTY client:

  1. Download and open PuTTY.
  2. Enter your server IP in the Host Name (or IP address) field and 22 in the Port field; leave the connection type as SSH.
  3. To reuse the connection, type a name in Saved Sessions and click Save.
  4. Click Open and confirm the security alert with Accept.
  5. Enter your username at the login as: prompt, followed by your password.

Connecting to a Server via SSH from macOS and Linux

macOS and Linux come with an SSH client out of the box. Just open the Terminal app and use the same command:

ssh [email protected]

For servers you connect to often, you can define a shortcut in the ~/.ssh/config file:

Host myserver
    HostName 203.0.113.10
    User root
    Port 22

From then on, simply type ssh myserver to connect. The same file also works with the Windows OpenSSH client at C:\Users\YourName\.ssh\config.

Passwordless and Secure Login with an SSH Key

Using an SSH key instead of a password is both more secure and more convenient. A key pair has two parts: the private key that stays on your computer and the public key that you upload to the server. Never share your private key with anyone.

1. Create a key pair

ssh-keygen -t ed25519 -C "[email protected]"

Press Enter to accept the default location and optionally set a passphrase to protect your key. The keys are saved as ~/.ssh/id_ed25519 (private) and ~/.ssh/id_ed25519.pub (public). On older systems without Ed25519 support, use ssh-keygen -t rsa -b 4096.

2. Copy the public key to the server

On macOS and Linux:

ssh-copy-id [email protected]

Windows PowerShell doesn't include ssh-copy-id, so you can use this command instead:

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

3. Test logging in with the key

The ssh [email protected] command should now connect without asking for a password (or only ask for your key passphrase). If you use PuTTY, convert your key to .ppk format with PuTTYgen and select it under Connection › SSH › Auth › Credentials.

Common SSH Errors and How to Fix Them

ErrorLikely causeFix
Connection timed outWrong IP, server is down or the port is blocked by a firewallCheck the IP and that the server is running; open the SSH port in the firewall.
Connection refusedSSH service isn't running or a different port is usedSpecify the correct port with -p; start the service via the VNC console in your panel.
Permission denied (publickey,password)Wrong username/password or password login is disabledCheck your username and password; if key authentication is required, use the correct key.
REMOTE HOST IDENTIFICATION HAS CHANGEDThe server was reinstalled and its fingerprint changedRemove the old entry with ssh-keygen -R 203.0.113.10 and connect again.

Take the last error seriously if you didn't reinstall the server yourself; an unexpected fingerprint change may indicate an interception attack.

Basic Settings for SSH Security

Every server exposed to the internet faces automated password-guessing attacks on port 22. Once you've confirmed that key login works, the following settings are recommended:

  • Disable password login: Set PasswordAuthentication no in /etc/ssh/sshd_config.
  • Restrict root login: Create a separate user with sudo rights and use PermitRootLogin prohibit-password or no.
  • Install Fail2ban: It automatically blocks IP addresses that make too many failed attempts.
  • Use a firewall: Keep only the necessary ports open with UFW or firewalld.
  • Consider changing the port: A non-default port reduces automated scanning traffic, but it isn't a security measure on its own.

After making changes, restart the service with sudo systemctl restart ssh (sshd on RHEL-based systems). To avoid locking yourself out, test the connection in a new terminal without closing your current session.

Conclusion

Being able to connect to a server via SSH is the most secure and most common way to manage your Linux server. On Windows 10/11, macOS and Linux you can connect with a single ssh user@ip command, or do the same through a graphical interface with PuTTY. Using an SSH key instead of a password and applying basic security settings will largely protect your server against attacks. When pointing your server to a domain, check out our DNS propagation guide, and read our VDS vs VPS comparison to choose the right infrastructure. You can also explore our VDS server and VPS server plans with full root access.

Frequently asked questions

What people ask most about this topic

Windows 10/11, macOS and Linux come with a built-in SSH client; just type ssh user@ip in PowerShell or Terminal. If you prefer a graphical interface, you can use the free PuTTY program on Windows.

Was this article helpful? Share it:
Related service

VDS Server

Dedicated vCPU and RAM, NVMe storage and locations in Turkey, Germany and Finland.

  • DDoS-protected infrastructure
  • 24/7 expert support
Back to all articles
Knowledge Base

You may also find these useful

All articles