Skill 3 in course 2.4: Network and Security
SSH Key Authentication
Log in without a password using key pairs, and tighten the SSH server's rules without locking yourself out.
You will be able to
- Create a key pair, install the public key on another host, and log in without a password.
- Explain which file and which permissions make key authentication work, and fix them when it fails.
- Change sshd settings safely using drop-in files, a syntax test and a second session.
- Forbid root and password logins, restrict users, and run sshd on a different port with SELinux and the firewall updated.
Lessons
- 01Key-based SSH loginGenerate a key pair, install the public key on another system, log in without a password, and debug it when it refuses.
ssh-keygenssh-copy-id~/.ssh/authorized_keysssh-agentssh-addssh -v0/5 exercises - 02Securing the SSH serverChange sshd's behaviour with drop-in files, forbid root and password logins, limit who may connect, and move the port the right way.
sshd -tsshd -T/etc/ssh/sshd_config.dPermitRootLoginPasswordAuthenticationAllowGroups0/5 exercises