Linux, terminal and Git

Stage 8 of 8 · 9 lessons · ~3 weeks

SSH, servers and debugging

Log into remote machines with SSH keys, set up and secure a small Linux server, keep work running with tmux, and debug problems with logs and networking tools.

Start: Logging in with SSH

Lessons· one lesson for each topic, in this order

  1. 1Logging in with SSH
  2. 2The SSH config file
  3. 3Copying files: scp and rsync
  4. 4Your first server, set up safely
  5. 5tmux: sessions that survive disconnects
  6. 6Services and logs
  7. 7Talking HTTP with curl
  8. 8Network checks: DNS, ping and ports
  9. 9A method for debugging your environment

Do this

  • Create a small VPS or free-tier instance and set a billing alert.
  • Create a sudo user, copy your key with `ssh-copy-id`, then disable root and password login.
  • Enable ufw allowing only SSH and the ports you need.
  • Add the server to `~/.ssh/config` and deploy a folder with `rsync --dry-run`, then for real.
  • Run a long job inside tmux, disconnect and reattach.
  • Serve a simple site or API, check it with `curl -i`, and read its logs with journalctl.
  • Find which process holds a port with `ss` or `lsof`.
  • Write a one-page runbook and delete the server when you no longer need it.

Start with· follow one of these

Practise

Keep handy

Also worth your time

  • The server, networking and troubleshooting branches of the Linux map

Before moving on: A small Linux server you set up yourself: a sudo user with key-only SSH, root and password login disabled, a firewall, a simple site or API served and checked with curl, your cron script running on it, and a one-page runbook covering how to log in, read logs, restart the service and what to check when it fails.

Tauseef's advice
A cheap server you can break and rebuild teaches you more than any course, as long as you set a billing alert first and delete it when you are done. Keep a runbook as you go. When something breaks, read the logs before you search the error; the answer is usually right there.

Mark this stage as not done?