CertGrid CertGrid
Hands-on Lab·Red Hat Certified System Administrator

SSH Key-Based Authentication

One objective, three commands, and two failure modes that produce the identical unhelpful message. Both are demonstrated: a permissive ~/.ssh on the server, which sshd silently refuses, and a readable private key on the client, which ssh refuses with a wall of asterisks.

Security and SELinux Guide 53 of 67 Intermediate

sshd's StrictModes defaults to yes and refuses to use authorized_keys if the home directory or ~/.ssh is writable by anyone but the owner. It logs the reason and tells the client only Permission denied (publickey), so the useful detail is on the server in the journal.

Keys are generated on RHCSA-A01 and used against RHCSA-B01.
Server NameIP AddressOSRolesCPURAMHDD
RHCSA-A01192.168.0.31RHEL 10.0Practice node (graded) - spare /dev/sda2 Core4 GB50 GB + 15 GB
RHCSA-B01192.168.0.33RHEL 10.0Practice node 2 - spare /dev/sdb2 Core4 GB50 GB + 15 GB

This guide includes

Use this when key authentication silently falls back to a password. This matters because two completely different failures produce the identical symptom - one on the server and one on the client, and both are about permissions.

Before you start

  1. Generate

  2. Copy and use

  3. StrictModes on the server

  4. And the client side

Official sources