I've got a problem, where even though i set a password and try to log in with it, it doesn't work. I created a new user called test with password test. When i try to log in i get "access denied". I tried to re-set the password many times, but that didn't change anything.
-
Do you try to login remote or local ? – Overmind Jun 02 '16 at 09:20
-
Can you share your logs : /var/loglog/secure – SAM Jun 02 '16 at 09:08
-
What do the logs say? – Jenny D Jun 02 '16 at 09:47
-
Hello, sorry but i'm not on my pc right now. – Jojo Coana Jun 02 '16 at 10:11
3 Answers
Use another to check the log by with sudo tail -f /var/log/secure
It shows something like this,
Jul 4 16:24:06 iz2ze86eplnjdk8exdjimjz sshd[17288]: pam_tally2(sshd:auth): user lv (1002) tally 31, deny 5
From the output it shows the reason, then solve it.
For the above case, the user is locked for enter too many uncorrect passwd before.
Check it with pam_tally2 -u lv
Login Failures Latest failure From
lv 32 07/04/20 16:24:59 115.171.85.163
Reset it with pam_tally2 -u lvi -r --reset
Login Failures Latest failure From
lv 32 07/04/20 16:24:59 115.171.85.163
Check it again pam_tally2 -u lv
Login Failures Latest failure From
lv` 0
After reset on lv, lv can login successful.
Here is the login strategy
cat /etc/pam.d/sshd
1 #%PAM-1.0
2 auth required pam_tally2.so deny=5 unlock_time=600 even_deny_root root_unlock_time=60

- 343
- 3
- 11
that's possible when there's no profile file created for user. Please verify under /home there's path for user. If there's none, remove user and when creating account for him use -m option to create home directory it will also consists .profile file.

- 434
- 3
- 7
Whoops the problem was that i hadn't allowed this user in sshd config.

- 41
- 1
- 5
-
1Nothing wrong with the answer but adding more detail about what you put in the sshd config to allow the user would make it a better answer for anyone in the future – Drifter104 Jun 02 '16 at 13:48