Why am I seeing a "The SSH server rejected your password" error?

PROBLEM DESCRIPTION or QUESTION


When connecting to a remote server using the SSH protocol, the screen below appears.

image-20240510-071447.png

RESOLUTION


This could be one of the following causes:

  • You provided an incorrect password.

  • Your password contains complex characters.

  • If you’re logging in as root, the server may be rejecting root logins.

 

Xshell can handle most strings, including special characters, so these cases are very rare.

If you suspect that the problem is due to a complex password string, you can try specifying a relatively simple password and confirming the problem. If this is the case, please contact us by email at support@netsarang.com so we can rectify the issue.

 

As for logging in as root, most recent systems tend to restrict remote login as root . It is recommended that you log in as a standard user, use the ‘su’ or ‘sudo’ command, and then perform tasks with administrator privileges.


If you need to log in directly as root for some reason, you must allow logging as root in the SSH server's daemon settings.

$ sudo vi /etc/ssh/sshd_config ... #PermitRootLogin prohibit-password #=> Allowed in case of public key authentication #PermitRootLogin no #=> Deny all remote connections as root regardless of authentication method PermitRootLogin yes #=> Allow all remote access as root regardless of authentication method ...
$ sudo systemctl restart sshd