Everything about SSH: making a key, the config file, file permissions, hardening a server and login notifications.

6 notes
Best practice: generate an SSH key pair Best practice for generating an Ed25519 SSH key pair with ssh-keygen, and what the options mean.Apr 20, 2022
Connect to a Cisco switch with SSH Fix "no matching key exchange method found" when connecting to an old Cisco switch with SSH.Apr 20, 2020
Harden an SSH Server: sshd, Firewall and fail2ban Keys only, no root login, a firewall and fail2ban: the settings I put on every Linux server that is reachable over SSH.Nov 28, 2026
Login Email Notifications with PAM Get an email every time someone logs in over SSH or on the console, using PAM and a small script.May 6, 2016
Permissions for SSH Files The correct permissions for ~/.ssh, your keys, authorized_keys and config.Dec 9, 2016
SSH config file Examples of the SSH client config file: users, keys, agent forwarding and jump hosts.Oct 30, 2016
README.md PDF

🔐 SSH

My SSH notes, from the first key to a hardened server.

🧭 In this order

  1. Generate an SSH key pair: Ed25519, a passphrase, and what the options mean
  2. The SSH config file: short names for your servers, keys per host, jump hosts
  3. Permissions for SSH files: why SSH refuses a key that others can read
  4. Harden an SSH server: keys only, no root login, a firewall and fail2ban
  5. Login email notifications with PAM: a mail every time someone logs in

Old network gear: Connect to a Cisco switch with SSH (“no matching key exchange method found”).

⚡ Quick reference

ssh-keygen -t ed25519 -C "me@laptop"          # a new key pair
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server   # put your public key on a server
ssh-keygen -lf ~/.ssh/id_ed25519.pub          # the fingerprint of your key
ssh-keygen -R server                           # forget an old host key (after a reinstall)
ssh -J jumphost user@internal-server           # via a jump host
ssh -L 8080:localhost:80 user@server           # forward a local port to the server

🔗 Go deeper