shio

~/shio.sh/learn/ssh $ ./read

chapter 10 · learn the terminal

ssh — talking to another computer

ssh opens a shell on another machine. Everything you've learned, but on a computer in a different room — or a different city.

$ what ssh is

ssh — "secure shell" — opens a terminal session on a different computer. You type, but the commands run elsewhere. The screen shows you what's happening over there, in real time.

It's the same shell you've been learning. Same pwd, same ls, same cat. The only difference is the machine on the other end.

ssh you@your-mac

That says: "open a shell on the computer named your-mac, as the user named you." If everything's configured, you land in your home folder on that machine. Type exit to come back.

$ keys, not passwords

Modern ssh uses cryptographic keys instead of passwords. You generate a pair: a private key (stays on your device, never shared) and a public key (you copy to the remote machine).

When you connect, the two halves prove to each other that you're you. It's faster than typing a password and dramatically more secure.

This is the part most "learn ssh" tutorials make confusing. The short version: on your phone, on your laptop, anywhere you'll connect from, you have a key. On any machine you want to connect to, the matching public half is added to a file called ~/.ssh/authorized_keys.

$ try it (gently)

This sandbox won't actually talk to a real computer — but it knows one trick. Type ssh shio.sh and see what happens.

try: ssh shio.sh

$ you're ready

You've just learned the rough shape of every shell on the planet. The commands you've practiced here — pwd, ls, cd, cat, echo, mkdir, touch, mv, cp, rm, grep, find, ssh — are the daily vocabulary of millions of working programmers. You speak it now too.

The natural next step is to use it. If you have a Mac and an iPhone, the cleanest way to keep this going is to SSH into your Mac from your phone. We've written a careful, four-step guide for that.

Continue at /setup

~/shio.sh/learn/ssh $ cd ..