What is SSH?
SSH is a protocol for secure remote login and other secure network services over a network you do not trust, such as the internet. That is close to how RFC 4251, the document that defines the SSH architecture, describes it. In practice it means you can sit at a laptop in Pune, type one command, and get a terminal on a Linux server in Mumbai, with everything you type and everything the server prints encrypted on the way.
Before SSH, remote login tools such as Telnet and rlogin sent everything, passwords included, as plain text. Anyone on the path between you and the server could read it. SSH replaced them by wrapping the whole session in encryption and by making the server prove who it is before you send a password.
SSH is a protocol, not a single program. The most widely used implementation is OpenSSH, which OpenBSD developers started in 1999 from an older free SSH release. It ships with Linux distributions, macOS and current versions of Windows. The client command is ssh; the server program that listens for connections is sshd, the SSH daemon.
What does SSH stand for?
SSH stands for Secure Shell. A shell is the command-line program, such as bash, that reads what you type and runs it. "Secure Shell" is a slightly misleading name, because SSH does far more than give you a shell: it also copies files, forwards network ports and carries Git traffic. The name stuck because remote login was the first job it did.
Today, "SSH" means SSH-2, the version the IETF standardised in a set of RFCs published in January 2006. When a guide or a tool says SSH, this is the protocol it means.
How SSH works: the three protocol layers
RFC 4251 splits SSH into three protocols stacked on top of each other, each with its own RFC. Knowing the layers makes error messages much easier to read, because each error comes from one layer.
| Layer | RFC | What it does | Errors you see when it fails |
|---|---|---|---|
| Transport layer | RFC 4253 | Runs over TCP, agrees on encryption, proves the server's identity with its host key, protects every packet from tampering | Connection refused or timed out, host key changed, no matching key exchange or cipher |
| User authentication | RFC 4252 | Proves who you are to the server: public key, password or host-based | Permission denied (publickey), Permission denied (publickey,password) |
| Connection protocol | RFC 4254 | Splits the single encrypted connection into channels: shell sessions, commands, SFTP, forwarded ports | Port forwarding refused, subsystem request failed |
1. The transport layer
Your client opens a TCP connection to the server. Both sides announce their SSH version, then agree on a key exchange method, a cipher and an integrity check from the lists each one supports. The key exchange produces a shared session key that neither side ever sends across the network. During the same exchange the server signs data with its host key, and your client checks that signature. From this point everything is encrypted, including the login step that follows. RFC 4253 notes the transport can also compress data, though that is rarely switched on today.
2. User authentication
Only now does the server ask who you are. RFC 4252 defines three methods, and makes only one of them mandatory for implementations:
- publickey (required): you prove you hold a private key matching a public key the server already trusts.
- password (optional): you send a password, inside the encrypted tunnel.
- hostbased (optional): the server trusts a whole client machine. It is rare outside closed clusters.
The server tells the client which methods it will accept, which is why a failed login prints a list in brackets such as (publickey,password).
3. The connection protocol
Once you are logged in, RFC 4254 lets one encrypted connection carry many channels at once. RFC 4254 says plainly that all terminal sessions and forwarded connections are channels. Your interactive shell is one channel; an SFTP file browser is another, started as a named "subsystem"; a forwarded database port is a third. They all share one TCP connection and one login.
SSH port 22
An SSH server normally listens on TCP port 22. RFC 4253 says so directly and notes that the port is registered with IANA. In OpenSSH the setting is Port in /etc/ssh/sshd_config, and the manual gives 22 as the default.
You can move SSH to another port, and some people do to cut down the noise of automated login attempts in their logs. It is not a security control on its own: scanners find SSH on any port within minutes. Key-only login and a firewall do the real work. If you move the port, open the new one in your firewall first, then connect with ssh -p 2222 user@host. When a connection fails before any password prompt, the cause is almost always at this level; our guide to SSH connection refused on port 22 covers the checks. For the other ports a hosting account uses, see cPanel port numbers.
Host keys and the first-connection fingerprint prompt
Every SSH server has at least one host key, a key pair created when sshd is installed. It identifies the server, the way a passport identifies a person. The first time you connect, your client has never seen that key before, so OpenSSH stops and asks:
The authenticity of host '203.0.113.10 (203.0.113.10)' can't be established.
ED25519 key fingerprint is SHA256:Xm4c...(43 characters)...
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
The fingerprint is a short hash of the server's public host key. RFC 4251 is frank that the protocol cannot, by itself, know whether a host key really belongs to the server you meant to reach. It suggests checking a fingerprint through another channel, such as a phone call or a provider's console. If you type yes, the client saves the key in ~/.ssh/known_hosts, and every later connection is checked against it silently. This approach is often called "trust on first use".
To check the fingerprint properly, compare it with what the server itself reports. From a web console or another session already on the server, run:
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
If the two SHA256 strings match, you are talking to the right machine. RFC 4255 also defines SSHFP records, which publish host key fingerprints in DNS so clients can check them automatically, but few setups use them.
The warning you should never wave through is the opposite case: REMOTE HOST IDENTIFICATION HAS CHANGED. It means the key in known_hosts no longer matches what the server presents. The innocent explanation is that the server was rebuilt or its IP address reused; the dangerous one is someone sitting in the middle. Confirm which it is before you remove the old line. The OpenSSH StrictHostKeyChecking option controls how strict the client is about all this.
Password vs key authentication
| Password | SSH key | |
|---|---|---|
| What proves it is you | A secret you type, sent to the server inside the encrypted tunnel | A private key on your device; the server only ever holds the public half |
| Can it be guessed? | Yes, bots try common passwords on every public server | Not in practice; Ed25519 keys are far too long to guess |
| If the server is compromised | The attacker may capture the password you type | The private key never leaves your machine |
| Convenience | Nothing to set up, but you type it every time | One-time setup, then no typing (or one passphrase, cached by an agent) |
| In the RFC | Optional method | The only required method |
OpenSSH still allows password login by default; PasswordAuthentication in sshd_config defaults to yes. On a server facing the internet, the usual practice is to set up a key, test that it works in a second terminal, and only then turn passwords off. Modern keys are usually Ed25519, which RFC 8709 added to SSH. Generating a key, adding it to a server and to GitHub, and rotating it are covered step by step in what is an SSH key, and the hardening order for a new server is in our Ubuntu VPS initial setup guide.
What is SSH used for?
Because the connection protocol can carry any number of channels, one SSH login does several quite different jobs:
- Remote shell and commands. The everyday use: log in and manage a server, or run one command without staying, such as
ssh user@host uptime. Step-by-step instructions for Windows, Mac and Linux are in how to SSH into a server, and in Hindi in SSH kaise kare. - File transfer with SFTP and SCP. SFTP runs as a subsystem inside an SSH connection, and SCP and rsync also travel over SSH, so they use the same port, keys and login. See SFTP and SCP explained, and FTP vs SFTP vs FTPS if you are choosing between them.
- Tunnels and port forwarding. SSH can carry other TCP traffic, for example to reach a database that only listens on the server's localhost, or to act as a SOCKS proxy. Our guide to SSH tunnels covers
-L,-Rand-D. - Git. The Pro Git book calls SSH a common transport for self-hosted Git. A URL such as
git@github.com:user/repo.gitorssh://user@server/project.gitmeans every push and pull is an SSH connection authenticated with your key. - Automation. Deployment scripts, backups, configuration tools such as Ansible and CI pipelines log in over SSH with keys, with no person typing.
SSH client and server
Every SSH connection has two ends. The client is on your device: OpenSSH's ssh in a terminal, or a graphical client such as PuTTY or a file manager that speaks SFTP. The server is sshd on the remote machine. On most Linux servers it starts at boot, reads /etc/ssh/sshd_config and listens on port 22.
On the client side, two files do most of the work: ~/.ssh/known_hosts remembers the servers you trust, and ~/.ssh/config stores shortcuts such as a host alias, user name, port and key file, so ssh web can replace a long command. On the server side, ~/.ssh/authorized_keys in each user's home directory lists the public keys allowed to log in as that user.
SSH is also not only for VPS and dedicated servers. On shared hosting, SSH access is available on request on our Web & cPanel hosting plans, and always on a VPS, as noted in our documentation.
If you cannot get in to a new server, or a fingerprint does not match what you expect, message us on WhatsApp at +91 75994 50220 at any time, call during IST working hours, or write to support@bigdomainhost.com, and we will help you work out which layer is failing.
This guide was written by the Bigdomainhost team with AI assistance; facts were checked against the linked RFCs and OpenSSH documentation on 27 November 2026.
Sources (checked )
- IETF (RFC Editor): RFC 4251: The Secure Shell (SSH) Protocol Architecture
- IETF (RFC Editor): RFC 4252: The Secure Shell (SSH) Authentication Protocol
- IETF (RFC Editor): RFC 4253: The Secure Shell (SSH) Transport Layer Protocol
- IETF (RFC Editor): RFC 4254: The Secure Shell (SSH) Connection Protocol
- IETF (RFC Editor): RFC 4255: Using DNS to Securely Publish SSH Key Fingerprints
- IETF (RFC Editor): RFC 8709: Ed25519 and Ed448 Public Key Algorithms for the SSH Protocol
- OpenBSD: ssh(1) manual page
- OpenBSD: sshd_config(5) manual page
- OpenSSH: Project history
- Git (Pro Git book): Git on the Server: The Protocols