Since a lot of people moved to Linux Mint from Windows, here is a way to login with a pin but still use password as sudo.
You will need the libpam-pwdfile module.
- First, open up a terminal and install the libpam-pwdfile module:
Code: Select all
sudo apt install -y libpam-pwdfile
- Next, install whois:
Code: Select all
sudo apt install whois
- Now login as root from terminal
Code: Select all
sudo -i
- Backup your lightdm login manager file:
Code: Select all
cp /etc/pam.d/lightdm /etc/pam.d/lighdm_ORIGINAL
- Run the pin creation script: (replace YOURNAME with your username)
Code: Select all
echo "YOURNAME:$(mkpasswd -5)" > /etc/custompinfile
- Open the lightdm login manager file:
Code: Select all
sudo gedit /etc/pam.d/lightdm
- Add this line to the top:
Code: Select all
#%PAM-1.0 auth sufficient pam_pwdfile.so pwdfile=/etc/custompinfile
- Make the custompasswordfile read only:
Code: Select all
chmod 400 /etc/custompinfile
Open up passwords and keys (seahorse), right click on login and click on change password, enter your old password and enter the new pin. If it doesn't work, you can leave it blank if the computer is only accessible to you.
Restart computer and login with your pin
Credits to: https://askubuntu.com/a/1304887, adapted for Linux Mint