SSH fails with 'Received disconnect' only for select users

I have the following issue:

when trying to ssh to a remote server using a specific user, the response from the server is

Received disconnect from ***: 11:

Disconnected from ***

if I try connecting with a random user name or root, the server responds (normally, I assume!) by asking for the password

root@***'s password:

If I attempt connections using lftp or sftp, the same happens: the connection is dropped right away for the select user This makes me wonder whether the users in question where blacklisted on the server. Is this possible? What else could be the cause for this strange behavior?

Added to that, here's another strange fact: if trying to ftp to the remote server using a ftp client (e.g. FileZilla) the connection is accepted! Could it be a protocol issue?

Thanks a lot for the help.

3

2 Answers

Yes user level blocking is very much possible via sshd configuration

File is /etc/ssh/sshd_config

DenyUsers Arjun@hostname

Hope this helped

Check the /home directory permissions. It should be

  • drwxr-xr-x. 9 root root 113 Jun 28 22:57 home

and then your home directory detail:

  • drwxr----- 5 user group 124 May 18 17:00 User drwx------ 2 user group 29 May 18 12:05 .ssh -rw------- 1 user group 2235 Jun 28 23:09 authorized_keys

My error messages in logs

/var/log/secure > sshd[22565]: error: Received disconnect from X.X.X.X: 14: No supported authentication methods available [preauth]

On client side

ssh user@X.X.X.X Permission denied (publickey). ssh -vvv user@X.X.X.X ... debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (publickey).
On server side

  • service sshd stop

  • run sshd debug mode:

  • /usr/sbin/sshd -ddd

    ... debug1: trying public key file /home/USER/.ssh/authorized_keys debug1: Could not open authorized keys '/home/USER/.ssh/authorized_keys': Permission denied ...

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like