Back to LabsSSH Key AuthenticationMedium
LinuxSecurity
👥 18 users⏱ 20 min200 points
Set up SSH key-based authentication and disable password login.
Instructions
- Generate an SSH key pair.
- Copy the public key to the server's authorized_keys.
- Disable password authentication in sshd_config and restart SSH.
Prerequisites
- Basic SSH usage
- Server access
Hints
- Use 'ssh-keygen' to generate keys.
- Use 'ssh-copy-id' or manually append to ~/.ssh/authorized_keys.
- Edit /etc/ssh/sshd_config and set 'PasswordAuthentication no'.
Try it yourself!