Troubleshooting “Password Authentication Failed” over SSH
When connecting to a new cloud server, I repeatedly received Password authentication failed. Resetting the password and editing sshd_config did not solve it.
The original command omitted the remote username:
| |
That makes SSH use the current local username, which may not exist on the server. Supplying the expected remote account fixed the connection:
| |
-v prints diagnostic information, while root@ selects the remote account. Many cloud images disable direct root login; in that case use the image’s documented default user, such as ubuntu, ec2-user, or a custom account:
| |
Also verify the security-group/firewall rule for port 22, key-file permissions, server username, and server authentication logs. Prefer key authentication and a non-root administrative account over enabling root password login.