SSH: Permission denied — causes and solutions

12.03.2026
Complexity
min.

Summary

The error "Permission denied (publickey,password)" during SSH connection means the server rejected authentication. Check the password, keys, file permissions, and SSH server settings.

Applies to:
✔ VPS
✔ Dedicated servers
✔ Linux

Connect with debug output

ssh -v root@SERVER_IP

The output will show at which stage authentication failed.

Cause 1: wrong password

Make sure you're entering the correct password. Note:

  • Characters are not displayed when typing the password
  • Check keyboard layout and Caps Lock

If the password is lost, reset it via VNC/IPMI console:

passwd root

Cause 2: password authentication disabled

Via VNC/IPMI console, check SSH settings:

grep -E "PasswordAuthentication|PermitRootLogin" /etc/ssh/sshd_config

If PasswordAuthentication no, password login is disabled. To temporarily enable:

sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config
systemctl restart sshd

Cause 3: wrong SSH key

If using a key, make sure the public part is added on the server:

cat ~/.ssh/authorized_keys

Check which key the client is offering:

ssh -v root@SERVER_IP 2>&1 | grep "Offering"

Cause 4: wrong file permissions

chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys
chown -R root:root /root/.ssh

Cause 5: AllowUsers/AllowGroups directive

grep -E "AllowUsers|AllowGroups|DenyUsers" /etc/ssh/sshd_config

If AllowUsers is specified and root is not listed, add it:

AllowUsers root yourusername
systemctl restart sshd

Cause 6: PermitRootLogin disabled

grep PermitRootLogin /etc/ssh/sshd_config

If the value is no, change to yes or prohibit-password:

sed -i "s/PermitRootLogin no/PermitRootLogin yes/" /etc/ssh/sshd_config
systemctl restart sshd

Verification

ssh root@SERVER_IP
If the connection still fails after all checks, open a support ticket. Include:
- output of ssh -v root@IP
- contents of /etc/ssh/sshd_config (if accessible via VNC/IPMI)
Was this information helpful?
Yes   No
 
By continuing to use this website you will be agreeing to the website Acceptable Use Policy and the Use of Cookies while using the website and our services. Please also read our Privacy Policy under which, to the extent stated, you consent to the processing of your personal data.