I would like to have different passwords for my account(s): When (e.g.) a certain USB stick is plugged in then an easy password is to be used. The idea is: If I leave my computer then I take the stick with me and the easy passwords shall be disabled then.
My general idea is:
- Detect the stick with udev, maybe detect certain data on it (with a script run by udev) and react accordingly (e.g. create a file which is deleted when the stick is plugged out). This should be easy.
- Have PAM check for the existence of this file and select the password database accordingly.
The main question is probably (i.e. if I understand the structure of the problem correctly): Can
pam_unix2 be configured to use another shadow file? I just had a look at the man page for
pam_unix2 and it seems that this is not possible because this module lets glibc NSS make this decision.