How to SSH Into a Server (Windows, Mac and Linux)
Part of New VPS setup, our guide to this topic
To SSH into a server, open a terminal (PowerShell on Windows 10 or 11, Terminal on macOS or Linux) and run ssh root@YOUR_SERVER_IP with the IP and user from your provider’s welcome email. Type yes once to trust the server’s fingerprint, then enter the password or let your key log you in. Type exit to leave.
On this page
What you need before you SSH into a server
SSH is a program on your computer that talks to a program on the server, called sshd, over port 22. Everything travels encrypted. If you’re still fuzzy on what you’ve actually rented, our explainer on what a VPS actually is covers that first.
Your provider’s welcome email or control panel should give you four things:
- The IP address, something like
203.0.113.10. - A username. On most VPS images it’s
root. If your provider set up a different user, the email says which. - A password or a private key. Some providers email a root password. Others ask you to upload a public key when you order, and then there is no password at all.
- The port. It’s 22 unless the provider says otherwise.
One more thing to find now: the web console in your provider’s panel (often called VNC, serial or rescue console). It reaches the server without SSH. When SSH breaks, that console is how you get back in, so open it once while everything still works.
How to SSH into a server in 5 steps
The command is the same on Windows, macOS and Linux. Only step 1, opening a terminal, differs.
Open a terminal
Windows 10 or 11. Open PowerShell or Windows Terminal from the Start menu. Microsoft ships the OpenSSH client as an optional Windows feature from Windows 10 build 1809 on, so it may already be there. Check:
your computerssh -V
Check: A version line that starts with OpenSSH_for_Windows. Any version is fine for this guide.
If it fails: PowerShell says the term ssh is not recognized. Add the client in Settings › Optional features (search for OpenSSH Client), or open PowerShell as administrator and run these two commands, which come from the “Install OpenSSH Server & Client” section of Microsoft’s Get started with OpenSSH for Windows guide:
your computerGet-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
The first shows whether the client is Installed or NotPresent; the second adds it. You don’t need PuTTY.
Microsoft lists Windows 10 build 1809 as the minimum for its built-in OpenSSH. Source: learn.microsoft.com, captured Nov 20, 2026.
macOS. Open Terminal (Applications › Utilities). The ssh command is already installed.
Linux. Open any terminal. If ssh is missing on Ubuntu or Debian, install the client:
your computersudo apt install openssh-client
Run the ssh command
Replace the placeholder with your server’s IP and run:
your computerssh root@YOUR_SERVER_IP
The part before @ is the user, the part after is the server. If your provider gave you a different user, put that before the @ instead.
If SSH listens on another port, add -p:
your computerssh -p YOUR_PORT root@YOUR_SERVER_IP
If the provider gave you a private key file, point to it with -i. On macOS and Linux:
your computerssh -i ~/.ssh/YOUR_KEY root@YOUR_SERVER_IP
In Windows PowerShell, spell out the folder:
your computerssh -i $env:USERPROFILE\.ssh\YOUR_KEY root@YOUR_SERVER_IP
Check the server’s fingerprint
The first time you connect, ssh stops and asks:
outputThe authenticity of host 'YOUR_SERVER_IP (YOUR_SERVER_IP)' can't be established.
ED25519 key fingerprint is SHA256:...
Are you sure you want to continue connecting (yes/no/[fingerprint])?
That’s ssh saying it has never met this machine. Every server has a host key, and the fingerprint is a short summary of it. If someone sat between you and your server, you’d see their fingerprint instead.
Most people type yes. To do it properly, log in through the provider’s web console and run the command the OpenSSH ssh manual gives for this:
your computer → serverssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub
If the SHA256: string matches the one in your terminal, it’s your server. You can type yes, or paste the fingerprint itself at the prompt.
Check: Warning: Permanently added 'YOUR_SERVER_IP' (ED25519) to the list of known hosts. ssh saves the key in ~/ (on Windows, C:\Users\you\.ssh\known_hosts) and checks it silently on every later login.
If the key ever changes, ssh prints a large warning and turns off password login for that connection. The manual says this is to stop server spoofing and man-in-the-middle attacks. The problems section below covers when that’s harmless.
A changed host key means a warning and no password login for that connection. Source: man.openbsd.org, captured Nov 20, 2026.
Log in with your password or key
With a password, ssh asks for it next. Nothing appears on screen while you type: no dots, no stars. That’s normal; Microsoft’s guide calls it a security precaution. Type or paste it and press Enter.
With a key, there’s no server password. If the key has a passphrase, ssh asks for that instead. Don’t mix the two up: the passphrase unlocks the key file on your own computer.
If you’d rather use keys from the start, we have separate guides on making an SSH key on Windows and on how SSH key login works, including how to turn password login off safely.
Confirm you’re in, then log out
Your prompt changes to something like root@your-hostname:~#. You’re now typing on the server, not your laptop. Two quick checks:
serverwhoami
hostname
Check: whoami prints the user you logged in as; hostname prints the server’s name, not your computer’s.
To leave, type exit. If a session freezes because your Wi-Fi dropped, press Enter, then type ~. (tilde, then a dot). The ssh manual lists it as the escape that disconnects at once.
Key takeaways
- To SSH into a server, run
ssh root@YOUR_SERVER_IP; the command is the same on Windows, macOS and Linux. - Add
-pfor another port and-ifor a key file. - Check the fingerprint once from the web console, then type yes; ssh remembers it after that.
- Find your provider’s web console before you need it. It’s the way back in when SSH fails.
- Timed out means nothing answered, refused means nothing listens on that port, and permission denied means the login itself was rejected.
A VPS for this guide
Everything above runs on any VPS with 1 GB of RAM. The cheapest 1 GB+ plan at each provider whose prices we read every day, IPv4 included:
| Plan · provider | vCPU · RAM · disk | You pay | Visit |
|---|---|---|---|
KVM VPS Special 1 GB RackNerd · Los Angeles +19 | 1 vCPU·1 GB·20 GB | $1.83/mo | |
VPS pico G11.5s netcup · Nuremberg | 1 vCPU·1 GB·30 GB | $2.00/mo | |
SSD VPS 1 CloudCone · USA | 2 vCPU·1 GB·30 GB | $2.33/mo | |
1 slice InterServer · New York +2 | 1 vCPU·2 GB·40 GB | $3.00/mo | |
NVMe 2 GB HostHatch · Amsterdam +15 | 1 vCPU·2 GB·10 GB | $4.00/mo |
Prices read Dec 4, 2026. gets that provider's deals on Telegram. Compare every 1 GB plan →
Save the login so you type less
Typing the IP every time gets old. Put the details in a config file on your computer, at ~/.ssh/config (Windows: C:\Users\you\.ssh\config):
Host myvps
HostName YOUR_SERVER_IP
User root
Port 22
IdentityFile ~/.ssh/YOUR_KEY
ServerAliveInterval 30
Now ssh myvps does the same as the full command. Leave out the IdentityFile line if you log in with a password. ServerAliveInterval 30 makes ssh check in every 30 seconds when nothing is happening. The ssh_config manual sets its default to 0, which means off. Turning it on lets ssh spot a dead connection instead of hanging.
Common problems when you SSH into a server
Read the last line of the error. It tells you how far the connection got, and that tells you where to look.
Connection timed out.You see ssh: connect to host YOUR_SERVER_IP port 22: Connection timed out. Nothing answered at all. Check the IP for typos, then check the panel: the server may still be installing or may be switched off. Next suspect is a firewall dropping port 22, either the provider’s network firewall or ufw on the server. Some office, school and hotel networks also block outgoing port 22; try your phone’s hotspot. Then log in through the web console to look at the server side.
Connection refused.The server answered, but nothing listens on that port. Either you’re using the wrong port, or the SSH server isn’t running. From the web console on Ubuntu, sudo apt install openssh-server puts it back if it’s missing. Ubuntu 24.04 starts SSH through systemd socket activation (ssh.socket). If you changed Port in /etc/ssh/sshd_config or in a file under /etc/ssh/sshd_config.d/, a plain restart isn’t enough. Ubuntu’s openssh-server notes say to run:
sudo sshd -t
sudo systemctl daemon-reload
sudo systemctl restart ssh.socket
sshd -t checks the config first and prints nothing when it’s fine. Also allow the new port in your firewall before you switch.
Permission denied, please try again.The password was wrong, or the user was. Check both against the welcome email; usernames are case-sensitive. A pasted password with a space at the end fails too.
Permission denied (publickey).The server only accepts keys, and none of the keys you offered matched. OpenSSH’s own default lets root log in with a key but not a password (PermitRootLogin prohibit-password in the sshd_config manual). Many VPS images change that so the emailed root password works; some don’t. Run the login again with -v to see which keys ssh tried:
ssh -v root@YOUR_SERVER_IP
If no key was offered, fix the -i path. If the right key was offered and refused, the public key isn’t on the server; add it to ~/.ssh/authorized_keys from the web console. The key login guide linked in step 4 shows how.
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!The fingerprint no longer matches what you saved in step 3. That’s expected if you just reinstalled the OS or the provider gave you an IP someone else used. If you did neither, stop and ask the provider before you log in. When you know the change is yours, delete the old entry and connect again, checking the new fingerprint:
ssh-keygen -R YOUR_SERVER_IP
“ssh is not recognized” on Windows.The OpenSSH client isn’t installed. Go back to step 1.
After your first SSH login
Logging in is step two, not the finish line. Before you install anything, work through our new VPS setup checklist: a sudo user, key login, root and password login off, a firewall and automatic updates. It takes about 30 minutes.
Once the basics are done, pick something to run. Self-hosting n8n is a good first project if you automate things.
If you haven’t bought a server yet, compare VPS prices by real monthly cost first. Renewal prices and setup fees are included.
Questions
What port does SSH use?
Port 22 by default. Your provider may set another one; it will be in the welcome email or the control panel. Connect to it with ssh -p.
Do I need PuTTY to SSH into a server from Windows?
No. Windows 10 (build 1809 and later) and Windows 11 have Microsoft’s OpenSSH client as an optional feature, and it runs in PowerShell. PuTTY still works if you prefer a window with saved sessions.
Is it safe to type yes at the fingerprint prompt?
On a fresh server you just bought, the risk is low but not zero. The proper check takes a minute: run ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub in the web console and compare. Never type yes after a “host identification has changed” warning you can’t explain.
Why can’t I see my password when I type it?
ssh doesn’t show password characters, not even as dots. Type it and press Enter. If you keep getting it wrong, paste it from the welcome email.
How do I SSH into a server with a key file?
Add -i and the path to the private key: ssh -i ~/.ssh/YOUR_KEY root@YOUR_SERVER_IP. If the key has a passphrase, ssh asks for that, not the server password.
How we checked: We checked every command against the OpenSSH manual pages, Microsoft Learn’s OpenSSH documentation and Ubuntu’s openssh-server documentation, and the error texts against the OpenSSH source. We did not run them on every provider’s images, so defaults such as the username or root login can differ from one host to the next. How we check.