xyb3rt/physlock

millions of 'auth could not identify password for [user]'

GregorZattler opened this issue · 19 comments

First of all, many thanks for physlock!

Today my laptop woke via rtcwake while I was in the room. Only one hour later I realized heavy fan noise. I tried to unlock but the laptop did not respond to key presses. I shut it down using the power button. Now I realize there are millions of lines in auth.log stating

auth could not identify password for [user]

The first time I see this in auth.log is July 21st:

Jul 21 17:01:15 len physlock[30098]: pam_unix(physlock:auth): auth could not identify password for [user]
Jul 21 17:01:15 len physlock[30098]: Authentication failure
Jul 21 17:01:15 len physlock[30098]: pam_unix(physlock:auth): auth could not identify password for [user]
Jul 21 17:01:15 len physlock[30098]: Authentication failure
Jul 21 17:01:15 len physlock[30098]: pam_unix(physlock:auth): auth could not identify password for [user]
Jul 21 17:01:15 len physlock[30098]: Authentication failure
Jul 21 17:01:15 len physlock[30098]: pam_unix(physlock:auth): auth could not identify password for [root]
Jul 21 17:01:15 len physlock[30098]: Authentication failure
Jul 21 17:01:15 len physlock[30098]: pam_unix(physlock:auth): auth could not identify password for [user]
Jul 21 17:01:15 len physlock[30098]: Authentication failure
Jul 21 17:01:15 len physlock[30098]: pam_unix(physlock:auth): auth could not identify password for [user]
Jul 21 17:01:15 len physlock[30098]: Authentication failure
Jul 21 17:01:15 len physlock[30098]: pam_unix(physlock:auth): auth could not identify password for [user]
Jul 21 17:01:15 len physlock[30098]: Authentication failure
Jul 21 17:01:15 len physlock[30098]: pam_unix(physlock:auth): auth could not identify password for [root]
Jul 21 17:01:15 len physlock[30098]: Authentication failure

$ sudo grep -c 'auth could not identify password for [user]' /var/log/auth.log /var/log/auth.log.1
/var/log/auth.log: 27314371
/var/log/auth.log.1:83549249

There are for instance 8838 lines with date stamp Aug 5 08:45:06 within one second.

From browsing these auth.log files I found among millions of such lines at july 30 a single line where a sudo command is logged which I typed in at the time, presumably (or a remote hacker issuing a command I often issue as sudo). So it looks as if these lines are also generated while I was working on a unlocked system.

This is
debian stable (stretch) and the last kernel upgrade to
vmlinuz-4.9.0-7-amd64 was at Jul 16 20:13 accordingt to initrd time stamp.

$ physlock -v
physlock git-20170918 - lock all consoles

I'll upgrade physlock to git master.

It happened again, I had to reboot the computer. Perhaps it's helpful to note that it happened in both cases where it freezed, after the computer came out of suspend. In both cases + 1h later I wanted to unlock it and it was frozen.

Thanks for looking into this.

Are you able to unlock physlock's password prompt under normal circumstances?

Physlock uses PAM for authentication and the error generated from the PAM module pam_unix indicates that it cannot authenticate the users named user and root because their passwords are null. Waking your system with rtcwake seems to have some impact on your PAM config.

Are you able to unlock physlock's password prompt under normal circumstances?

Yes, several times a day.

Waking your system with rtcwake seems to have some impact on your PAM config.

OK, but why are there thousands of physlock attempts to get authetification per second in the first place?

My problem is the million attempts to unlock, which obviously are not the result of a human interacting with the computer. It doesn't bother me, that these millions of attempts to unlock failed. The very first and basic problem is hard disk space. ATM:

du -shc /var/log/auth.log*
12G /var/log/auth.log
12G /var/log/auth.log.1
21M /var/log/auth.log.2.gz
46M /var/log/auth.log.3.gz
128K /var/log/auth.log.4.gz
140K /var/log/auth.log.5.gz
23G total

This is on a otherwise heavily used laptop SSD of only 128 GB.

Normally, meaning if I type in passwords, physlock will slow down the appearence of the next password prompt if I enter a wrong password. But this does not apply here.

Can you please paste the contents of the files /etc/pam.d/physlock (very likely does not exist) and /etc/pam.d/other?

Can you please also post /etc/pam.d/common-auth?

There's nothing unusual in your pam config that would explain such intermittent failures. What was displayed on the console when you were unable to unlock it?

I've revised the PAM error handling in order to prevent the excessive logging. However, this does not address the inability to unlock the computer in such a failure case.

Closing it as there‘s nothing more for me to do. Feel free to reopen in case you have new information regarding the PAM errors.

Hi, it's me again. Thanks for physlock and the fix "in order to prevent the excessive logging".

This worked till Oct 14th. Now auth.log weighs 19 Gigabytes:

$ ls -l auth.log
-rw-r----- 1 root adm 19623837273 Okt 18 20:23 auth.log

This is with
$ physlock -v
physlock v11-35-g15744f5

I checked that it is this version which is used in my scripts.

Thanks for looking into this. Have a nice day, Gregor

I have no idea what's causing this. Are the log messages the same messages you've posted in your initial report?

To sum up, this is what is happening: Computer is idle (not suspended) and locked with physlock; its password prompt is visible. Cron starts the backup process. Part of this process is mounting an encrypted block device. At this time physlock enters the auth-fail-loop.

Can you give me more detail on the backup process/script? Are you prompted for an encryption password?

I too am at a loss here. Neither do I know whats causing the error, nor do I know how to fix the excessive logging because the error code physlock gets is the same it gets after a wrong password has been entered.

physlock itself generates no log messages. All the log messages you're seeing are generated in libpam. Also, the whole reason of using PAM is to make non-password authentication possible.

Get some errors looks like this.
Version: physlock 11-35-g15744f5
If i lock screen via sudo physlock -m, after some time gets messages in journalctl -b | grep physlock:

Feb 05 14:08:45 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:08:45 UbuSSD physlock[25144]: pam_unix(physlock:auth): auth could not identify password for [root]
Feb 05 14:18:46 UbuSSD sudo[2482]: drdeimos : TTY=unknown ; PWD=/home/drdeimos ; USER=root ; COMMAND=/usr/bin/physlock -m
Feb 05 14:18:46 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:18:46 UbuSSD physlock[25144]: pam_unix(physlock:auth): auth could not identify password for [drdeimos]
Feb 05 14:28:47 UbuSSD sudo[4649]: drdeimos : TTY=unknown ; PWD=/home/drdeimos ; USER=root ; COMMAND=/usr/bin/physlock -m
Feb 05 14:28:47 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:28:47 UbuSSD physlock[25144]: pam_unix(physlock:auth): auth could not identify password for [drdeimos]
Feb 05 14:38:48 UbuSSD sudo[6620]: drdeimos : TTY=unknown ; PWD=/home/drdeimos ; USER=root ; COMMAND=/usr/bin/physlock -m
Feb 05 14:38:48 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:38:48 UbuSSD physlock[25144]: pam_unix(physlock:auth): auth could not identify password for [drdeimos]
Feb 05 14:48:49 UbuSSD sudo[8596]: drdeimos : TTY=unknown ; PWD=/home/drdeimos ; USER=root ; COMMAND=/usr/bin/physlock -m
Feb 05 14:48:49 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:48:49 UbuSSD physlock[25144]: pam_unix(physlock:auth): auth could not identify password for [root]
Feb 05 14:58:50 UbuSSD sudo[10486]: drdeimos : TTY=unknown ; PWD=/home/drdeimos ; USER=root ; COMMAND=/usr/bin/physlock -m
Feb 05 14:58:50 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:58:50 UbuSSD physlock[25144]: pam_unix(physlock:auth): auth could not identify password for [drdeimos]

and on screen it's look like someone try to login multiple times with wrong password.
Maybe this is some timeout while physlock communicate with pam.d?
Look:

Feb 05 11:56:25 UbuSSD physlock[30558]: pam_unix(physlock:auth): conversation failed
Feb 05 13:26:34 UbuSSD physlock[22695]: pam_unix(physlock:auth): conversation failed
Feb 05 13:38:42 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 13:48:43 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 13:58:44 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:08:45 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:18:46 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:28:47 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:38:48 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:48:49 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed
Feb 05 14:58:50 UbuSSD physlock[25144]: pam_unix(physlock:auth): conversation failed

last 9 times (in this time laptop was locked and i don't interact with him). The same exactly every 10 minutes.