Skip to content
SSH10 min read14.08.2026

How to Fix SSH Permission Denied (publickey,password)

Permission denied appears after the network connection reaches the SSH server but the server rejects your identity. The authentication methods shown in the error help narrow the cause.

Permission deniedpublickeypasswordauthorized_keys
Password and private key credentials in Varkuna SSH

What does Permission denied mean?

The message means that the client reached the SSH server but the server did not accept the submitted user identity. Focus on the username and authentication method rather than the network port or firewall.

The publickey, password or keyboard-interactive values in parentheses describe methods offered or attempted during authentication. The exact list depends on server configuration.

Username and password checks

Correct username

The account may be root, ubuntu, debian or provider-specific. Do not confuse the hosting-panel account with the SSH account.

Retype the password

Check capitalization, keyboard layout, invisible spaces and stale autofill values.

Is password login enabled?

When PasswordAuthentication is disabled, even a correct password is rejected and a private key is required.

Is the account blocked?

Repeated failures, fail2ban or provider policy can temporarily block an account or source IP.

Avoid repeated guessing

Rapid random attempts can lock the account or IP. Verify the information before trying again.

When using a private key

  1. 1
    Select the matching key

    Use the private key paired with the public key on the server. Avoid similarly named old key files.

  2. 2
    Check the key passphrase

    A private-key passphrase is not the server account password; it was chosen when the key was created.

  3. 3
    Check the key format

    Use an OpenSSH or compatible format supported by the client. A truncated or damaged file cannot be loaded.

  4. 4
    Verify the public key on the server

    The matching one-line public key must be in the correct user’s ~/.ssh/authorized_keys file.

authorized_keys ownership and permissions

OpenSSH may ignore authorized_keys when ownership or permissions are unsafe. The home directory, .ssh directory and key file should not be writable by unrelated users.

A common setup is 700 for .ssh and 600 for authorized_keys. Group policy, ACLs or centralized identity systems may differ, so inspect the existing server policy first.

Common user permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chown -R "$(id -un)":"$(id -gn)" ~/.ssh
Recent server logs
sudo journalctl -u ssh --since '10 minutes ago'
# The service may be named sshd on RHEL/Fedora
Use the intended account

Apply ownership and permission changes only to the .ssh directory of the account you are troubleshooting.

Review server configuration

PubkeyAuthentication

Must be enabled for public-key authentication.

AuthorizedKeysFile

Shows whether the server reads keys from a non-default location.

AllowUsers / AllowGroups

The account may not be in the list of permitted users or groups.

PermitRootLogin

Root login may be disabled or restricted to key authentication.

Test configuration first

Run sudo sshd -t after editing sshd_config. Keep the current administrator session open until a new connection succeeds.

Quick diagnosis order

  1. 1
    Verify the username

    Keys and passwords for one account do not authenticate another account.

  2. 2
    Identify the allowed method

    Use a key when password login is disabled, or another method explicitly allowed by the server.

  3. 3
    Select the correct credential

    Confirm that the saved profile is not linked to an old password or key.

  4. 4
    Read server logs

    They can reveal an invalid user, rejected key or unsafe file permission more clearly than the client message.

Continue

Put the guide into practice.

Review the related Varkuna product or open its detailed user guide.