Secure Shell
The encrypted protocol for logging into and running commands on remote machines, authenticated by key pairs, that also tunnels other traffic and underpins Git.
Secure Shell (SSH) is a protocol for logging into and running commands on a remote computer over an encrypted connection. It replaced Telnet and rsh, which sent everything, passwords included, as plain text. Tatu Ylönen wrote the first version in 1995 after a password-sniffing attack at Helsinki University of Technology. OpenSSH, released in 1999, became the standard implementation and ships with nearly every Unix-like system.
When a client connects, the two sides first negotiate an encrypted channel, much like Transport Layer Security. The server proves its identity with its host key. On the first connection, the client shows the key's fingerprint and asks whether to trust it, then remembers it in a known_hosts file. If the key changes, the client warns loudly, since someone may be intercepting the connection. This trust on first use model avoids needing a Certificate Authority, at the cost of the first connection being unverified.
Users usually authenticate with a key pair rather than a password, using Public-Key Cryptography:
- The private key stays on the user's machine, ideally protected by a passphrase. SSH refuses to use it if its File Permissions let other users read it.
- The public key goes into
~/.ssh/authorized_keyson each server the user may log into. - Login works by the server sending a challenge that only the private key can sign, so no secret crosses the network.
An SSH agent holds decrypted keys in memory so the passphrase is typed once per session, and keys can live on hardware security keys. Large organizations often use SSH certificates, so servers trust any key an internal authority has signed. Handling keys carefully is part of Secret Management.
SSH does much more than remote shells:
- File transfer.
scp,sftp, andrsynccopy files over SSH connections. - Git. Pushing to and pulling from hosted repositories commonly uses SSH keys for authentication, and Git can also sign commits with them, a lightweight form of Code Signing.
- Port forwarding. SSH can carry other traffic through its encrypted connection. Local forwarding makes a remote service, such as a database bound to a private Port, appear on the local machine; remote forwarding does the reverse. This makes SSH a lightweight stand-in for a Virtual Private Network.
- Jump hosts. Connections can hop through a bastion server into a private network.
Because SSH is powerful, its servers are constant targets. Internet-facing servers see password-guessing bots within minutes. Common hardening disables password login and direct root login, limits which users may connect, and puts SSH behind a Firewall or a mesh network, moving toward a Zero Trust Network model where access depends on identity rather than network location. A 2024 backdoor planted in the xz compression library, aimed at OpenSSH, was caught shortly before wide release.
See also2
Pseudoterminal
The kernel device pair that lets a terminal window, SSH session, or tmux pane pretend to be a 1970s hardware terminal, and why programs behave differently when they are not attached to one.
Systems & Tooling12 connections
Command-Line Interface
Operating a computer by typing commands and reading text replies, the interface inherited from teletypes that remains the fastest, most scriptable, and least discoverable way to control software.
Systems & Tooling14 connections
Linked from14
- Certificate AuthorityNetworks & Distribution
An organization trusted to vouch that a public key belongs to a domain or entity, the root of trust behind every HTTPS padlock.
- ClipboardSystems & Tooling
The shared buffer behind cut, copy, and paste, invented at Xerox PARC, which offers data in several formats at once and has become a channel for snooping and for commands that paste differently from how they looked.
- Command-Line InterfaceSystems & Tooling
Operating a computer by typing commands and reading text replies, the interface inherited from teletypes that remains the fastest, most scriptable, and least discoverable way to control software.
- Commit SigningVersion Control & Delivery
Cryptographically signing Git commits so a commit's author can be verified rather than merely claimed, the key types used, and what a green verified badge does and does not prove.
- DotfilesSystems & Tooling
A tracked repository of personal configuration, making a machine setup reproducible.
- File PermissionsSystems & Tooling
The Unix scheme of read, write, and execute rights for a file's owner, group, and everyone else, and the extensions that patch its gaps.
- FirewallNetworks & Distribution
A filter that allows or blocks network traffic by rule, the oldest perimeter defense, and less sufficient on its own than it used to be.
- GNU Privacy GuardSystems & Tooling
A free implementation of the OpenPGP standard for encrypting and signing files, email, and software releases, descended from Phil Zimmermann's PGP and known both for its importance to software distribution and for being hard to use.
- Network SocketNetworks & Distribution
The programming interface through which a program talks to the network, identified by an address and a port, and treated by the operating system as one more file descriptor.
- PortSystems & Tooling
The numeric endpoint a network service listens on, and a scarce shared resource on a developer machine.
- PseudoterminalSystems & Tooling
The kernel device pair that lets a terminal window, SSH session, or tmux pane pretend to be a 1970s hardware terminal, and why programs behave differently when they are not attached to one.
- Remote DesktopNetworks & Distribution
Controlling a computer from somewhere else by streaming its screen to a distant machine and sending keyboard and mouse input back, used for IT support, remote work and cloud gaming, and a favorite entry point for attackers when left exposed.
- SuperuserSystems & Tooling
The all-powerful root account on Unix systems, how sudo hands out its power temporarily, and why both attackers and good security design revolve around who gets it.
- Terminal MultiplexerSystems & Tooling
A program that runs many terminal sessions inside one window, splits it into panes, and keeps the sessions alive on a server after the connection drops, so long jobs and remote work survive disconnection.