Skip to content

Instantly share code, notes, and snippets.

@dmcbane
Last active August 4, 2024 18:41
Show Gist options
  • Save dmcbane/3ce77630e5070dc87ce777fc71c1ea72 to your computer and use it in GitHub Desktop.
Save dmcbane/3ce77630e5070dc87ce777fc71c1ea72 to your computer and use it in GitHub Desktop.
Setup Ubuntu for PIN login

Setup Ubuntu for PIN Login Instead of Long Password

  • Install packages if they aren't already installed.
sudo apt install libpam-pwdfile whois
  • Backup the Original PAM Configuration File
sudo cp /etc/pam.d/gdm-password /etc/pam.d/gdm-password_ORIGINAL
  • Create the Custom PIN File
echo "$(whoami):$(mkpasswd -5)" | sudo tee /etc/custompinfile
sudo chmod 400 /etc/custompinfile
  • Edit the PAM Configuration File to Enable the PIN file

Use your editor of choice with superuser privileges to edit the /ect/pam.d/gdm-password file to add auth sufficient pam_pwdfile.so pwdfile=/etc/custompinfile to the top of the file, similar to the following:

sudo vim /etc/pam.d/gdm-password

The top of your configuration file should look like the following:

#%PAM-1.0
auth    sufficient      pam_pwdfile.so  pwdfile=/etc/custompinfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment