xyb3rt / physlock

Lightweight linux console locking tool
GNU General Public License v2.0
303 stars 36 forks source link

Unable to unlock the computer after physlock locked it for passwordless user #80

Closed Mizuchi closed 5 years ago

Mizuchi commented 5 years ago

I am using updated Arch Linux with the physlock in official repo.

Steps to reproduce the problem.

  1. delete user password and root password by "passwd -d"
  2. lock screen by performing "physlock"

You might wonder why on earth would I do that? well I did it accidentally since my hotkeys are shared across multiple devices and some are passwordless.

actual behavior

physlock doesn't accept empty password, thus whatever I input, I will get this:

Password:
Authentication failed.

Password:
Authentication failed.

Password:
Authentication failed.

Root: Password:
Authentication failed.

expected behavior

physlock should either accept empty password (e.g. for passwordless user, without typing password should unlock it), or refuse to lock if both user and root are passwordless (otherwise we could never unlock it), slock will refuse to lock if user password is empty, since it never checks root password.

xyb3rt commented 5 years ago

Accepting empty passwords needs enabling in the PAM configuration:

$ man 8 pam_unix
[...]
Options
[...]
nullok
    The default action of this module is to not permit the user access to a service if their official password is blank. The nullok argument overrides this default.