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

Written against the versions above. 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.0 (Coughlan)Practice node (graded) - spare /dev/sda2 Core4 GB50 GB + 15 GB
RHCSA-B01192.168.0.33RHEL 10.0 (Coughlan)Practice node 2 - spare /dev/sdb2 Core4 GB50 GB + 15 GB

Before you start

  1. Generate

  2. Copy and use

  3. StrictModes on the server

  4. And the client side

Official sources