Shared server guidance · Question & answer

Why does SSH say Permission denied (publickey)?

This message means the SSH server did not accept an offered public-key identity for the requested account. It does not usually mean the network is unavailable. Confirm the username and exact key before changing server authentication policy.

IntermediateWindows 11 with Microsoft OpenSSH Client; Windows PowerShell 5.1 or PowerShell 7 as labelledLinux VPS and dedicated servers where a remote Linux command is shown
Go to the answer

Instructions

1. Check the intended client identity

Use the public fingerprint rather than relying on the filename or key comment.

Local Windows PowerShell
ssh-keygen -lf "$env:USERPROFILE\.ssh\server_ed25519.pub"

Compare it with the key enrolled for this exact remote account.

2. Make one explicit diagnostic attempt

Limit the offered identity and enable basic verbose output.

Local Windows PowerShell
ssh -v -o IdentitiesOnly=yes -i "$env:USERPROFILE\.ssh\server_ed25519" adminuser@203.0.113.10

Look for the username and offered key. The debug output can expose hostnames and local paths, so redact it before sharing.

3. Inspect the account through an existing trusted path

Confirm the public key is in the effective authorised-key source, with correct ownership and permissions. Check account restrictions and server logs. If you have no working login, use the authenticated provider console or the authorised key-management process.

Check the result

  • The offered public fingerprint matches the intended enrolled identity.
  • A fresh SSH connection authenticates as the expected account.

Troubleshooting

The key works for another username
Authorisation is account-specific. Use the account for which it was enrolled.
The key is present but rejected
Check file ownership, StrictModes requirements, account restrictions and applicable Match rules.

Official references

Use the documentation for your installed version when a flag, service name or platform feature differs.