Sign inSign up free

723. SSH Key Login Refused

medium 20 XP ~7 minHands-on lab

yusuf added their public key to ~/.ssh/authorized_keys on this server, but SSH ignores it and falls back to a password prompt. The server log says:

sshd[2311]: Authentication refused: bad ownership or modes for directory /home/yusuf

Task

Fix ownership and permissions so that sshd (with its default StrictModes yes) accepts yusuf's key. Keep the keys in authorized_keys as they are, and don't make anything readable by other users that isn't readable today.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Part of Prepare for the LFCS. Next step: Which sshd Setting Actually Wins?

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.