How to SSH into a server: the short version
To SSH into a server, open a terminal on your computer and run ssh username@server-ip, for example ssh root@203.0.113.10. The first time, check the host key fingerprint and type yes. Then sign in with your SSH key or password, and you get a shell on the remote machine. This works the same way from Windows 10 (version 1809 and later) and 11, macOS and Linux, because all three ship an OpenSSH client.
The rest of this guide explains what SSH is, what details you need before you connect, the exact commands for each operating system, and how to fix the errors people hit most often.
Quick checklist before you connect
- The server's public IP address or hostname.
- A username on the server, often
rooton a new VPS. - Your private key (if you added a public key at order time) or the account password.
- The port: 22 unless someone has changed it.
- Port 22 (or your custom port) open in every firewall between you and the server.
- A terminal: PowerShell or Windows Terminal, the macOS Terminal app, or any Linux terminal.
What is SSH, and what does SSH stand for?
SSH stands for Secure Shell. It is a protocol for logging in to a remote computer and running commands on it over an encrypted connection. Everything you type, including your password, is encrypted between your machine and the server, which is why SSH replaced older tools such as Telnet. The server runs an SSH daemon (sshd), which listens on TCP port 22 by default; your computer runs the SSH client, the ssh command.
SSH also checks the server's identity. Each server has a host key, and your client remembers it in ~/.ssh/known_hosts after the first connection. If that key ever changes unexpectedly, the client warns you rather than connecting silently.
The ssh command on macOS and Linux
Open Terminal and use the basic form of the ssh command:
ssh user@203.0.113.10
The options you will use most:
| Option | What it does | Example |
|---|---|---|
-p | Connect to a port other than 22 | ssh -p 2222 user@203.0.113.10 |
-i | Use a specific private key file | ssh -i ~/.ssh/work_ed25519 user@203.0.113.10 |
-l | Give the username separately | ssh -l user 203.0.113.10 |
-v | Print debugging output (up to -vvv) | ssh -v user@203.0.113.10 |
Without -i, the client tries your default keys, such as ~/.ssh/id_rsa, ~/.ssh/id_ecdsa and ~/.ssh/id_ed25519, plus any key loaded in ssh-agent. You can also write the destination as a URI: ssh ssh://user@203.0.113.10:2222.
How to SSH from Windows
Built-in OpenSSH in PowerShell or Windows Terminal
Windows 11 and Windows 10 from version 1809 include an OpenSSH client, so you do not need to install anything on a current build. Open PowerShell or Windows Terminal and type the same command as on a Mac:
ssh root@203.0.113.10
Your keys and known_hosts live in C:\Users\<you>\.ssh\, and every option in the table above works. If PowerShell says ssh is not recognised, the OpenSSH Client optional feature is not installed; add it from Optional features in Settings, or use PuTTY.
Using PuTTY
PuTTY is a free SSH client for Windows. To connect:
- Type the server's IP or hostname in Host Name.
- Choose SSH as the connection type; the port changes to 22.
- For key login, go to Connection > SSH > Auth > Credentials and select your private key. PuTTY uses its own
.ppkformat; PuTTYgen converts an OpenSSH key into it. - Click Open, check the host key prompt, and choose Accept to save the key.
- Enter your username at the
login as:prompt.
Passwords do not show on screen as you type, in PuTTY or in any other SSH client. That is normal.
How to set up SSH key login
Keys are safer than passwords and save you typing one every time. Create a key pair on your own computer:
ssh-keygen -t ed25519 -C "laptop"
Accept the default path, set a passphrase, and you get two files: id_ed25519 (private, never share it) and id_ed25519.pub (public). The public key goes on the server, in ~/.ssh/authorized_keys of the user you log in as. From macOS or Linux, if password login still works, copy it with:
ssh-copy-id user@203.0.113.10
Otherwise paste the contents of the .pub file into that file yourself, or into your provider's panel at order time. On the server, ~/.ssh should be mode 700 and authorized_keys 600 (chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys), and neither your home directory nor these files should be writable by other users, or sshd may ignore the key.
The first connection: verifying the host key fingerprint
The first time you connect, the client cannot know whether the key it receives really belongs to your server, so it asks:
The authenticity of host '203.0.113.10 (203.0.113.10)' can't be established.
ED25519 key fingerprint is SHA256:...
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Compare the fingerprint with the real one before answering. On the server itself, through a console that does not depend on SSH, run:
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
If the SHA256: strings match, type yes, or paste the fingerprint. The key is saved in known_hosts and you are not asked again. If they do not match, do not connect.
Common SSH errors and quick fixes
Connection refused
Your request reached the machine, but nothing accepted it on that port: sshd is stopped, listening on another port, or a firewall is rejecting the packet. Our separate guide to SSH connection refused errors works through each cause.
Connection timed out
No reply came back at all. Check that the IP is correct, that the server is powered on, and that port 22 is allowed in the server firewall and any provider firewall. Some office and public Wi-Fi networks block outgoing port 22; try another network to rule that out.
Permission denied (publickey)
The server only accepts keys and did not accept any you offered. Check, in order:
- The username is right: the image may expect
root, or a user such asubuntu. - You are offering the right key: add
-i path/to/key. - The public key is in that user's
~/.ssh/authorized_keys, with the permissions above. - Run
ssh -vto see which keys the client tried and what the server said.
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED
The server's host key no longer matches the one in your known_hosts. This is expected after you rebuild or reinstall a server, or when an IP moves to a new machine. It can also mean someone is intercepting the connection, so verify the new fingerprint first, as above. Once you are sure, remove the old entry and reconnect:
ssh-keygen -R 203.0.113.10
If you connect on a non-standard port, the entry is stored with the port, so remove it with ssh-keygen -R '[203.0.113.10]:2222'. Do not work around this warning by turning off StrictHostKeyChecking; that removes the protection the check gives you.
Save time with ~/.ssh/config
Instead of typing the user, port and key each time, give the server a short name in ~/.ssh/config:
Host web1
HostName 203.0.113.10
User deploy
Port 22
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 30
Now ssh web1 is enough, and scp and sftp use the same name. ServerAliveInterval sends a small probe every 30 seconds so idle connections are less likely to be dropped by routers. Put specific Host blocks above any Host * block, because for most settings the first value read wins.
Staying connected with tmux or screen
If your connection drops, anything running in that shell normally stops with it. For long jobs, such as an upgrade or a big copy, start a tmux session first:
tmux new -s work
# run your job, then detach with Ctrl+b followed by d
tmux attach -t work
The job keeps running on the server while you are disconnected. screen does the same job: screen -S work, detach with Ctrl+a then d, and reattach with screen -r work. Install either with your package manager if it is missing.
Logging out
Type exit or logout, or press Ctrl+d. If the session has frozen, press Enter, then type ~. (the escape only works at the start of a line) to make the OpenSSH client close the connection. In PuTTY, use exit rather than the window's close button unless the server has stopped responding.
SSH into your Bigdomainhost server
A Bigdomainhost KVM VPS gives you full root access over SSH, a dedicated IPv4 address, and Ubuntu, Debian or AlmaLinux images, in Mumbai (BOM-1) or Delhi NCR (DEL-1). The VPS quickstart recommends pasting your SSH public key at order time, which disables password login from the first boot; the panel shows the IP as soon as provisioning finishes, and you connect with ssh root@your-ip.
The panel's per-instance firewall denies inbound traffic except SSH on port 22, so if you move SSH to another port, open it there as well as on the server; the networking and firewall docs cover this. If you lock yourself out, the out-of-band console in the control panel still gets you in, and it is also where you can read the host key fingerprint. Once you are in, follow the Ubuntu VPS initial setup guide to add a sudo user and make SSH key-only. For help, call +91 75994 50220 during IST hours, WhatsApp the same number at any time, or email support@bigdomainhost.com.
Sources (checked )
- OpenBSD manual pages: ssh(1): OpenSSH remote login client
- OpenBSD manual pages: ssh_config(5): OpenSSH client configuration
- OpenBSD manual pages: ssh-keygen(1): key generation and management
- PuTTY documentation: Getting started with PuTTY
- PuTTY: PuTTY home page
- OpenBSD manual pages: tmux(1): terminal multiplexer
- IETF: RFC 4253: The Secure Shell (SSH) Transport Layer Protocol