09 Systems support · SSH · Linux
SSH access and private-key permissions
The SSH service is reachable, but access fails first with the wrong key and then because the correct key has an unsafe local file mode.
- Issue
- Port 22 answers, but the session fails. Is the key unauthorized, is the client refusing to use the private key, or is the requested account outside the server rule?
- Decisive evidence
- Port 22 was reachable while a different valid key was still denied by public-key authentication.E01
- Result
- A reachable SSH port does not prove that the client can use its key or that the server accepts the requested account.
- Boundary
- This is one isolated OpenSSH server using synthetic keys and accounts.Full limit
- Completion
- Complete within stated scope
- Execution
- Isolated OpenSSH client and server run
- Review
- Scripted assertions and artifact check
- Evidence
- Selected evidence on this page
- OpenSSH
- Alpine Linux
- Docker internal network
- ARM64
The support question
Port 22 answers, but the session fails. Is the key unauthorized, is the client refusing to use the private key, or is the requested account outside the server rule?
Project record: An isolated SSH server and client, synthetic keys and accounts, two failure states, the private-key mode correction, and a repeated remote file check.
Interactive view
Find where the SSH request stops.
The service remains reachable. The selected state shows whether the request stops at key authorization, local key handling, or the remote session.
TCP 22 answers, but the server does not accept the supplied public key.
- 01TCP 22SSH servicenormal
- 02Private-key modeClient-side checknormal
- 03Authorized keyServer-side checkfailed
- 04Allowed accountsshd boundaryfailed
- 05Remote commandIdentity and filefailed
The client refuses to use the authorized private key because mode 0644 exposes it to other users.
- 01TCP 22SSH servicenormal
- 02Private-key modeClient-side checkfailed
- 03Authorized keyServer-side checkunknown
- 04Allowed accountsshd boundaryunknown
- 05Remote commandIdentity and filefailed
At mode 0600, the allowed account completes the remote checks while an unknown account remains denied.
- 01TCP 22SSH servicenormal
- 02Private-key modeClient-side checkchanged
- 03Authorized keyServer-side checknormal
- 04Allowed accountsshd boundarynormal
- 05Remote commandIdentity and filenormal
Access checks
Separate service reachability, local key handling, server authorization, and account boundaries.
- 01
Start an OpenSSH server on an internal Docker network with one allowed synthetic account and one authorized public key.
- 02
Confirm that port 22 is reachable, then try a different valid key and record the public-key denial.
- 03
Use the authorized key with mode 0644 and record the client-side unsafe-permissions refusal.
- 04
Copy the key into the disposable client, set mode 0600, and run a remote identity and sentinel-file check.
- 05
Repeat the successful check in a new client and confirm that an unknown account still fails.
Evidence from the lab
The checks used to reach the conclusion.
Selected outputs from the lab. Sensitive and unnecessary details are omitted.
ssh-server:22 reachablelabops@ssh-server: Permission denied (publickey).WARNING: UNPROTECTED PRIVATE KEY FILE!
Permissions 0644 for 'lab_key' are too open.
This private key will be ignored.Full evidence archive5 additional artifacts+
before=0644
after=0600user=labops
arch=aarch64
sentinel=controlled remote support accessretest-user=labops
retest-sentinel=controlled remote support accessunknown@ssh-server: Permission denied (publickey).Public package
• service reachability
• key and permission failures
• correction and new-client retest
• negative account boundary
• SHA-256 checksumsResult and limits
What changed, and what this lab does not prove.
Result
The wrong key reached the server and was denied. The authorized key was ignored at mode 0644, then worked at mode 0600. Two new sessions read the expected sentinel through the allowed account, while an unknown account remained denied.
Limit
This is one isolated OpenSSH server using synthetic keys and accounts. It does not claim production bastion access, directory integration, certificate-based SSH, or enterprise key rotation.
Claims and evidence
What the evidence supports.
The result covers one isolated server and one unapproved lab key.
EvidenceE01E02The mode check uses the OpenSSH client inside one Alpine container.
EvidenceE03E04E05The boundary proves command access to one synthetic account and file.
EvidenceE05E06E07