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

What is SSH, and how does Secure Shell work?

If you run a server, SSH is how you get in, copy files and push code. This guide explains what SSH is, what the name stands for, the three protocol layers behind every connection, why port 22 matters, what the first-connection fingerprint prompt is asking, and the jobs SSH does beyond a remote shell.

Short answer: SSH (Secure Shell) is a network protocol for logging in to and running commands on a remote computer over an encrypted connection. A server listens on TCP port 22 by default. SSH proves the server's identity with a host key, then checks the user with a password or an SSH key, and also carries file transfers (SFTP, SCP), tunnels and Git.

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.

The three layers of the SSH protocol
LayerRFCWhat it doesErrors you see when it fails
Transport layerRFC 4253Runs over TCP, agrees on encryption, proves the server's identity with its host key, protects every packet from tamperingConnection refused or timed out, host key changed, no matching key exchange or cipher
User authenticationRFC 4252Proves who you are to the server: public key, password or host-basedPermission denied (publickey), Permission denied (publickey,password)
Connection protocolRFC 4254Splits the single encrypted connection into channels: shell sessions, commands, SFTP, forwarded portsPort 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

SSH password login compared with SSH key login
PasswordSSH key
What proves it is youA secret you type, sent to the server inside the encrypted tunnelA 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 serverNot in practice; Ed25519 keys are far too long to guess
If the server is compromisedThe attacker may capture the password you typeThe private key never leaves your machine
ConvenienceNothing to set up, but you type it every timeOne-time setup, then no typing (or one passphrase, cached by an agent)
In the RFCOptional methodThe 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, -R and -D.
  • Git. The Pro Git book calls SSH a common transport for self-hosted Git. A URL such as git@github.com:user/repo.git or ssh://user@server/project.git means 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 )

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 network protocol for logging in to a remote computer and running commands over an encrypted connection. Despite the name, it also handles file transfer with SFTP and SCP, port forwarding and Git traffic, all over the same encrypted connection.

What port does SSH use?

SSH servers listen on TCP port 22 by default. RFC 4253 names port 22 and notes it is registered with IANA, and OpenSSH uses 22 unless the Port setting in sshd_config says otherwise. You can move SSH to another port and connect with ssh -p, but that only reduces log noise; keys and a firewall provide the real protection.

Is SSH encrypted?

Yes. The SSH transport layer agrees on a session key with the server and encrypts everything after that point, including your password if you use one, every command and all output. It also checks each packet for tampering and verifies the server's identity with its host key before you log in.

What is the SSH fingerprint prompt on the first connection?

It is your SSH client showing a short hash of the server's host key because it has never seen that server before. Compare it with the fingerprint shown on the server itself, for example with ssh-keygen -lf on the host key file, then type yes. The key is saved in known_hosts and checked automatically on every later connection.

Is SSH key login safer than a password?

Yes, in most cases. A password can be guessed by bots or captured on a compromised server, while an SSH key cannot realistically be guessed and the private half never leaves your device. The usual practice is to set up a key, test it, then disable password login on the server.

What is the difference between SSH and SFTP?

SSH is the secure protocol and connection; SFTP is a file transfer protocol that runs inside an SSH connection as a subsystem. SFTP uses the same port, the same login and the same keys as SSH, so any account that can log in over SSH can usually transfer files with SFTP too.

What is the difference between SSH and Telnet?

Both give you a remote command line, but Telnet sends everything, passwords included, as plain text that anyone on the network path can read. SSH encrypts the whole session and verifies the server's identity first. Telnet should not be used for logging in to servers over the internet.

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.