I am trying to create new users using useradd
command using root credentials it is getting created properly but when I log in with the newly created user with its credentials using a PuTTY Console, I am able to enter the username but when I give the password, it hangs there for a long time until the PuTTY window session timeout happens and the window is closed. However when I use root credentials, it quickly enters the session.
I tried checking the AllowUsers
under file /etc/ssh/sshd_config
but I didn't find any matching entry, so, I manually tried adding AllowUsers temipuser
where temipuser
is the username I created. Post making this change from another PuTTY Console I again tried entering this username but it is again the same. I am totally clueless why is this happening.
Another thing is, if I add any user, say just temipuser
, to the AllowUsers
entry in the sshd_config
file, will the root user still have access or will it not get access? I don't want to screw the things here. I understand AllowUsers
lets only the specified users and denies others.
Best Answer
look for any relevant entries under
/var/log/secure
or/var/log/auth.log
. Also, make sure that you don't have custom rules added under/etc/security/access.conf
which might access to the server for that user.Those logs will contain information about failed logins and may indicate clearly what went wrong.
The
/etc/security/access.conf
file specifies (user/group, host), (user/group, network/netmask) or (user/group, tty) combinations for which a login will be either accepted or refused.