Zorin 17.2 - Unlock via PIN?

Was trying to find a way (after initial login) to enable using a PIN to unlock the computer. Found an online tutorial (https://randomblog.hu/setting-up-pin-unlock-for-ubuntu-linux/) that worked in Zorin 16 but appears to have broken in 17.2 core. Any thoughts from the broader group on an approach?

Thanks!

Click on :zorin: logo bottom of screen, then click on settings.

Scroll down and click on users.

From here is where you edit your account, and setup your password.


From memory Gnome rejects simple passwords which is why I suspect the link in the first post was mentioned! :wink:

I checked the link and it seems a good idea. However keep in mind that a PIN also has less characters to crack - but as one of my work colleagues said: a lock keeps a reliable guy out of your toolbox, a criminal will find a way past it.

Do you want to PIN via Zorin Connect or simply on the computer itself? That is another thought to consider.

You might run sudo nano /etc/security/pwquality.conf and set minlen length to four instead of eight.
Tap ctl+o to overwrite, enter to save current configuration, then ctl+x to exit.

Setting up PIN login on Ubuntu

To set up a PIN for logging into Ubuntu 22.04, follow these steps:

  1. Install Required Packages:
  • Open a terminal and run the following commands to install the necessary packages:
sudo apt-get update
sudo apt-get install -y libpam-pwdfile
sudo apt-get install -y whois
  1. Create the PIN File:
  • Generate the hashed PIN for your user account. Replace username with your actual username:
sudo bash -c "echo 'username:$(mkpasswd -5)' > /etc/custompinfile"
  • Ensure the file has the correct permissions:
sudo chmod 400 /etc/custompinfile
  1. Edit PAM Configuration:
  • Open the PAM configuration file for the login manager (usually gdm-password for GDM):
sudo nano /etc/pam.d/gdm-password
  • Add the following line near the top of the file:
auth sufficient pam_pwdfile.so pwdfile=/etc/custompinfile
  1. Test the Setup:
  • Log out and log back in. You should now be able to use your PIN to unlock your session.
  1. Revert Changes if Necessary:
  • If you encounter issues, you can revert the changes by restoring the original PAM configuration file:
sudo cp /etc/pam.d/gdm-password_ORIGINAL /etc/pam.d/gdm-password

Security Consideration: Be aware that a PIN is less secure than a longer, more complex password. Ensure that the /etc/custompinfile is properly secured and not accessible to unauthorized users.

Note: This method allows you to use a PIN for logging into the desktop but does not affect the password required for administrative tasks like sudo.

2 Likes

These instructions worked! I had missed applying the right file permissions to custompinfile. Thanks!

2 Likes

Searched this yesterday and got exact same method from AI , but decided not to post it due to the seemingly controversy with answers from AI.
:grin:
Glad it worked :+1:t2:

I used Brave via Mojeek. Which did you use?