SSH Client and Server
Level 1 · Connecting
What SSH is. How the ssh command on your laptop talks to sshd on a server, over port 22, on a line nobody else can read.
Course contentsLesson 1 of 9
Level 1 · Connecting
Level 2 · Keys and shortcuts
Level 3 · Locking the door
Level 4 · Moving files
Level 5 · Reaching further
After this lesson you can
- Log in to a server with ssh
- Tell the ssh client from the sshd server
- Say what SSH keeps safe on the way
10 mincovers 3 glossary entries
How SSH lets you type on a far machine
SSH, short for Secure Shell, lets you log in to a far computer and type commands on it. Everything on the way is locked, so nobody on the line can read it. You type ssh, a user name and an address, such as ssh emma@203.0.113.10. A program on the server answers on port 22 and asks who you are.
Two programs share the work. ssh is the client on your laptop. It sends what you type. sshd is the server program that waits on the far machine. It checks who you are, then starts a shell for you there.
A port is the number that says which program a message is for. One server can run many programs, each on its own port. sshd listens on port 22 unless someone changes it. A website uses 80 and 443.
Once you are in, the window looks the same as a local one. But every command now runs on the server. ls lists the server's files. Closing the window ends the login, and anything you started in it stops too.
SSH locks the line before any password or key is sent. Someone on the same cafe Wi-Fi sees only noise. Older tools like telnet sent every letter in plain text, which is why SSH replaced them.
On almost every Linux server, sshd is already running when you get it. macOS, Linux and Windows 10 and 11 all ship the ssh client. So you can start with no install at all.
A common mistake is to log in as root every time, because the host gave you root first. A mistake made as root can break the whole machine. Make your own user early, and log in as that user.
$ ssh emma@203.0.113.10
emma@web1:~$ hostname
web1
emma@web1:~$ exit
logoutWorked example
Lucy fixes her site from a train
Lucy's site shows an error while she is on a train. She has only her laptop and the train's Wi-Fi.
She types ssh lucy@203.0.113.10, restarts the web program, and logs out. It takes 2 minutes, and nobody on the train's network could read a word of it.
The words for this lesson3
Check yourself
Which program answers your ssh command on the server?
Finished this lesson?
Marking it complete also marks its 3 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.