errors

SSH authentication failure — public-key access

Permission denied (publickey) is an authentication failure, distinct from a host-key verification error or successful login with insufficient authorization. Check the intended username, key fingerprint, client key selection, authorized_keys location and ownership, server authentication policy and account state. Avoid sharing verbose logs before redacting paths and sensitive identifiers. Correct the selected identity or install the approved public key through an existing authorized session; fix only ownership/modes required by the server policy (often .ssh 0700 and authorized_keys 0600, but parent ownership and ACLs matter). Do not disable StrictModes or host-key verification, and do not copy private keys onto servers. Keep the existing session and alternate recovery access while verifying a new login. Roll back the authorized change if it fails; prevent with access reviews and tested recovery. The fixture models only group/other writability of a fictional authorized_keys file and fixes that private mode; no SSH client/server or actual key is used. Example prerequisites: Linux, Bash, Python 3. Run as a non-root user in a private temporary working directory. Example scope: synthetic model. Expected output: mode model: group/other write rejected; private mode accepted. No system configuration changes.

Formal Syntax & Structure

linux syntaxlinux
ssh -vvv -o BatchMode=yes USER@AUTHORIZED_HOST; ssh-keygen -lf PUBLIC_KEY; authorized server logs

Parameters & Attributes

NameTypeDescription
fingerprintdiagnostic evidenceCompare approved public key identities.
StrictModesdiagnostic evidenceServer ownership and mode checks.
server logsdiagnostic evidenceActual rejection reason where visible.

Return Value

Diagnostic observation

Expected normalized laboratory result: mode model: group/other write rejected; private mode accepted. A passing fixture does not prove that a live incident has the same cause.

Working Example

Example Snippetlinux
python3 - <<'PY'import tempfile,statfrom pathlib import Pathwith tempfile.TemporaryDirectory() as d:    p=Path(d)/'authorized_keys'; p.write_text('fictional record, not a key')    p.chmod(0o666)    unsafe=lambda: bool(stat.S_IMODE(p.stat().st_mode)&0o022)    assert unsafe(); p.chmod(0o600); assert not unsafe()print('mode model: group/other write rejected; private mode accepted')PY
Linux Reference