Talk to the NOC, IST hours — +91 75994 50220 support@bigdomainhost.com
Guide

How to connect to a server over SSH, step by step

SSH is how you log in to a VPS or dedicated server and run commands on it. This guide shows the exact commands for Windows, macOS and Linux, and how to fix the errors you are most likely to see.

Short answer: To SSH into a server, open a terminal and run ssh user@server-ip, adding -p for a non-standard port and -i for a specific key. On first connection, verify the host key fingerprint and type yes, then sign in with your key or password. Windows 10 (version 1809 and later) and Windows 11, macOS and Linux all include the ssh command; PuTTY is an alternative on Windows.

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

  1. The server's public IP address or hostname.
  2. A username on the server, often root on a new VPS.
  3. Your private key (if you added a public key at order time) or the account password.
  4. The port: 22 unless someone has changed it.
  5. Port 22 (or your custom port) open in every firewall between you and the server.
  6. 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:

OptionWhat it doesExample
-pConnect to a port other than 22ssh -p 2222 user@203.0.113.10
-iUse a specific private key filessh -i ~/.ssh/work_ed25519 user@203.0.113.10
-lGive the username separatelyssh -l user 203.0.113.10
-vPrint 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:

  1. Type the server's IP or hostname in Host Name.
  2. Choose SSH as the connection type; the port changes to 22.
  3. For key login, go to Connection > SSH > Auth > Credentials and select your private key. PuTTY uses its own .ppk format; PuTTYgen converts an OpenSSH key into it.
  4. Click Open, check the host key prompt, and choose Accept to save the key.
  5. 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 as ubuntu.
  • 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 -v to 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 )

Answers

Frequently asked questions

Still unsure? Call +91 75994 50220 or write to support@bigdomainhost.com — a human replies in IST hours.

What does SSH stand for?

SSH stands for Secure Shell. It is a protocol for logging in to a remote computer and running commands over an encrypted connection, so passwords and data cannot be read in transit. The server side, sshd, listens on TCP port 22 by default, and the client is the ssh command or a program such as PuTTY.

How do I SSH from Windows?

Windows 11 and Windows 10 from version 1809 include an OpenSSH client, so run ssh user@server-ip in PowerShell or Windows Terminal. Your keys go in the .ssh folder in your user profile. If you prefer a graphical client, install PuTTY, enter the IP in Host Name, choose SSH, select your .ppk key under Auth and click Open.

How do I SSH into a server on a different port?

Add the -p option with the port number, for example ssh -p 2222 user@203.0.113.10. In PuTTY, type the number in the Port box. To avoid typing it every time, add a Host block with a Port line to ~/.ssh/config. Make sure the new port is open in the server firewall and any provider firewall.

How do I fix Permission denied (publickey)?

Check that you are using the right username, then point the client at the right key with -i. Confirm your public key is in that user's ~/.ssh/authorized_keys, with ~/.ssh set to 700 and the file to 600. Running ssh -v shows which keys were offered and why the server rejected them.

Is it safe to type yes at the host key prompt?

Only after you have compared the fingerprint with the real one. Read it on the server through a console that does not use SSH, with ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub. If the SHA256 strings match, type yes and the key is saved to known_hosts. If they differ, do not connect.

Support that picks up the phone.

In IST hours, in Hindi or English, and WhatsApp replies fastest at any time. Sales, migration and emergencies all reach the same engineers. No offshore queue, no 48-hour first reply.

Need cPanel or WHM with the ports already sorted?

Web & cPanel hosting comes with cPanel ready to log in to, reseller hosting adds white-label WHM, and a KVM VPS can have cPanel & WHM pre-installed. Call +91 75994 50220 or email support@bigdomainhost.com.