-
-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to enter correct password #216
Comments
If this happens again, check the system logs for errors from the PAM subsystem. That may shed some light onto the situation. |
For some reason PAM is unable to get your authorization token, which should just be the encrypted password from /etc/shadow. You might try adding the following to /etc/sudoers and see if it makes any difference: Defaults !pam_setcred That will prevent sudo from reinitializing the user's credentials but I'm not sure whether that will really make a difference for password authentication. |
I've done this; it will take time to see if this does make any difference. In the meanwhile, is there anything else to check? As this occurs with each install of Arch Linux (with |
The issue still occurs with |
If you mistyped your password three times you could be getting locked out by the pam_faillock module for a period of time (defaults to 15 minutes). It is enabled by default in /etc/pam.d/system-auth on Arch. |
Yes, but this issue has occurred on the first attempt as well (it can occur upon any attempt). After entering correctly three times, I would get locked out. The issue is not getting locked out. The issue is that I could enter correctly multiple times and get rejected although the password is correct. |
To be more accurate, whenever the issue occurred, I never confirmed whether the first attempt was correct. I only confirmed subsequent immediate attempts. |
That is exactly the behavior I see when pam_faillock has locked me out. It doesn't matter whether you enter the password correctly or not, it will be rejected. For example, here I mistype the password three times, triggering pam_faillock.
Now I see this in the logs:
And if I try to use sudo with the correct password there is no way to tell that I am locked out.
And there is a file in the faillock directory:
Removing that lets me authenticate successfully (waiting until the lock period is over would also work). Can you check for pam_faillock messages in your logs? |
I see what you are saying now, thanks for clarifying. In the case of this occurring in the display manager, I believe it should mention the lock period, but it did not until entering the correct password three time, where it then proceeded to mention lock out. I can do the same as you to see the pam_faillock messages in the logs. However, with the issue, I am quite certain the last/prior attempt was successful. I don't recall whether there were pam_faillock messages in the logs when I've had the issue. I will check for the messages and the file in the faillock directory and return with results for when this occurs. I am currently using |
I experienced something similar described in this issue today. I too am using Arch Linux (aarch64 archlinuxarm flavor). I updated my packages today via the usual What was instantly interesting was that I was presented with a "With great power comes great responsibility [...]" when I tried doing sudo subsequently. This is funny because I have been using Then, I'm not sure if I genuinely typed my password 3 times wrongly or not. Could my password entry have been correct but due to the update of sudo version things went wonky ? Anyways after investigating later this seems to have triggered
Now I couldn't do sudo at all and this caused a slight panic. (I was not aware of pam_faillock ). Question: Only after restarting my machine I was able to log back in again. |
That does sound like pam_faillock. This is a PAM configuration issue, not a sudo bug. The reason you got the sudo lecture is that the path to the time stamp and lecture files changed in 1.9.15 so that is unrelated. |
Thanks for your comment, it was helpful. Yes, this is most likely a PAM issue it seems. I'm not really familiar with authentication on Linux. Would a Thanks again ! |
@sidkshatriya Yes, it would also prevent you from logging in via the graphical display manager. |
|
I'm experiencing this issue as well, though the name of the issue is not great. Something like "no way to distinguish between wrong password and locked account" would be a better name for the issue. The reason why sudo does not display the "The account is locked due to N failed logins." is because sudo passes PAM_SILENT to the Of course, not displaying this can be seen as a "security feature" since an attacker would not immediately know whether the password was wrong or the account locked, though since sudo is usually used by users who are already logged in, they could instead run I suggest that disabling the PAM_SILENT flag in sudo should be a configuration option or at least compile time flag, since some users would probably want to know when they have locked themselves out. I already have a branch implementing a config option for this, though I still need to test it and clean it up a bit (especially the documentation changes to the man pages) before I can open a PR for it |
I'm wondering why it is possible to lock on the first attempt. |
Faillock counts failed attempts over a configurable period, the default on Arch seems to be 15 minutes. The number of failed attempts counted by faillock is independent from the number of failed attempts counted by sudo (e.g. the "3 failed attempts" message). AFAIK, timeouts or canceled logins seem to also count as failed attempts. This combined can lead to situations where you only input one actually interactive attempt, and the others happen in a way that you don't notice. |
This does seem plausible. However, I have had this issue occur a number of times with |
@kojq That could very well be. In the meantime, I have created a PR that adds a config option to disable PAM_SILENT, so that the faillock messages can be displayed properly. |
Inspired by PR sudo-project#368 GitHub issue sudo-project#216
Inspired by PR sudo-project#368 GitHub issue sudo-project#216
This has now been released as of sudo 1.9.16. Just add |
Operating System information:
Arch Linux
(on bothGNOME
andKDE
)Current sudo version:
1.9.12.p1
For the past few months (when I began using sudo), I have noticed that on rare occasion, sudo denies the correct password upon the first and subsequent attempts. This occurs on multiple devices and lasts for ~4 minutes. My observation is that the password is rejected in the console, tty, and display manager (used GDM and SDDM). I do not know how to consistently replicate the situation.
The text was updated successfully, but these errors were encountered: