appzasGamesToolsDevLearnReferenceNetworkTimeCalculatorsCompareLLM prices

What is SSH?

Lesson 1 of 68 minBeginner

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, sftp or rsync.
  • Create encrypted tunnels to reach services that are not exposed.
  • Authenticate Git operations to services such as GitHub.

Your first connection

Connect as the user ana to a server (192.0.2.10 is a documentation address)
ssh ana@192.0.2.10

The 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.

1. Which TCP port does an SSH server listen on by default?
2. Which of these does SSH NOT provide?
3. In the SSH model, which program runs on the machine you connect TO?
HintThe form is: ssh user@host

Key terms