Lesson 14: SSH — connecting to a remote server
The team provisioned a new server — web-01.example.com. You're at your laptop. Now you need to connect, run a command, and leave. ssh deploy@web-01.example.com opens an encrypted shell — the prompt changes to deploy@web-01:~$ and from now on every command runs on the remote server. exit closes the s
ssh is like traveling to a friend's house and working there. Commands you type happen there, not at home. exit is the trip back.
- ssh
- ssh user@host opens an encrypted shell session on a remote server over port 22. The prompt changes after connecting — every command you run executes on the server, not on your local machine.
- SSH key
- A key pair: public and private. The public key lives on the server at ~/.ssh/authorized_keys. The private key stays on your machine at ~/.ssh/id_rsa. This is how you authenticate without a password.
- exit
- Closes the current session — SSH or local terminal. Inside SSH: disconnects from the remote server and the prompt returns to your local machine.