What is SSH?
What SSH is, why it replaced Telnet, and how the client and server fit together.
SSH (Secure Shell) is a protocol that lets you log in to another computer over a network, run commands on it and move files, with everything encrypted between the two machines.
The problem it solved
Before SSH, administrators used tools such as Telnet and rsh. They sent usernames, passwords and commands as plain text, so anyone on the network path could read them. SSH, created in 1995 and now standardized in RFC 4251 to 4254, adds three guarantees:
- Confidentiality: traffic is encrypted, so eavesdroppers see noise.
- Integrity: tampering is detected.
- Authentication: the server proves who it is to you, and you prove who you are to the server.
Client and server
SSH has two sides. The client (the ssh command) runs on your machine. The server (the sshd daemon) runs on the machine you connect to and listens on TCP port 22 by default. The most widely used implementation is OpenSSH, included in Linux, macOS and Windows 10 and later.
What you can do with it
- Open a remote shell:
ssh user@host. - Run a single remote command and get its output.
- Copy files securely with
scp,sftporrsync. - Create encrypted tunnels to reach services that are not exposed.
- Authenticate Git operations to services such as GitHub.
Your first connection
ssh ana@192.0.2.10The part before @ is the username on the remote machine and the part after it is the host, either an IP address or a name. If everything is correct you get a shell prompt on the remote machine. Type exit to come back.
NoteNever use Telnet on an untrusted network. If a service only offers it, wrap it in an SSH tunnel (lesson 5).
Test yourself
Answer all the questions, then check them. Finish with every answer right to mark the lesson as done.