Adding a PIN Zorin OS 18

Hello, I have noticed that there is no option for a PIN in place of a Password that may not be to the comfort of more easy going users like grandma using facebook or, for myself, a simple home computer

I have tried to see if it's more or less a feature that one would need to add in:

https://www.reddit.com/r/zorinos/comments/15fzurh/is_there_a_way_to_change_password_to_pin/

Unfortunately not even a chatbot, like the one from bing or google, is not as helpful.

Now I am aware of "preventing unauthorized use of your computer" I know, that's often argued on this topic

I don't want to argue, I just want help on making this adjustment for myself

I stumbled across a tutorial for a lot of settings in Zorin and Ubuntu. Some of them I tried and they worked well for me. I didn't test the PIN-part (5.4) though.
As for everything on the internet: read carefully and try to understand what those tipps are doing and of course don't forget your backup. :wink:
Also these seem to be the same steps as mentioned in the second Post for Ubuntu 22.

2 Likes

I have given it a shot! It doesn't work but that's one solution tried, there may be another.

Ok, I was curious and tried it myself and... it didn't worked out.
But it worked with this part to create the PIN:

Then take the username you use to log in, let's say "ben" and do this:

sudo -i

echo "ben:$(mkpasswd -5)" > /etc/custompinfile

This is taken from here:

Take note that I only used the part to become root and create the PIN. I didn't changed the rest of the process.

1 Like

Same here, root is set to a pin. Everything else still follows the same rules :confused:

Ok, just to be sure that we're talking about the same.

You entered:

sudo -i

to became root and then:

echo "yourusername:$(mkpasswd -5)" > /etc/custompinfile

and after that you can see in your /etc/custompinfile something like that:

yourusername:$1$oaXJ0Qe7$.jiYHSh8o84Up5op4MIi.

You locked your screen (Win + L) twice and still no login with the PIN you entered?

I looked at the bash log: I have done the first two however that last one is something I have not come across.

I have repeated the steps and I have not received an output similar to what you've shown and when I log out I cannot log in with my chosen pin

Hi and welcome.

Interesting threads here:

and here:

https://randomblog.hu/setting-up-pin-unlock-for-ubuntu-linux/#comments

in particular:

https://randomblog.hu/setting-up-pin-unlock-for-ubuntu-linux/#comment-1110

1 Like

Do you mean, that you don't have the file /etc/custompinfile ?
What do you get with sudo cat /etc/custompinfile ?

It should show you one line with your username and some characters aka the hash value of your entered PIN.

If not, what happened after sudo -i and echo "yourusername:$(mkpasswd -5)" > /etc/custompinfile ?

Maybe some typo somewhere?

I have the file /etc/custompinfile.
Yes I get a yourusername:thehashbutIdon'tknowifIshouldshareit.
password: is the only response I receive. I put in the PIN and it seems to work, no error just back to root.

All copy pasted, I read it before entering it so nothing suspicious was put in.

Have you had any bad luck with it too?

It works for me, after I entered the PIN with the sudo -i "workaround".

The PAM Config file contains the line at the top?

#%PAM-1.0
auth    sufficient  pam_pwdfile.so pwdfile=/etc/custompinfile

A more direct method (and what I use) is to set your regular password as a PIN.

If doing this at a later date than installation, you may need to change the password allowable length to change the password to a PIN:

sudo nano /etc/security/pwquality.conf

Find the line:

# minlen = 8 and remove the # and change the value to the desired PIN length: minlen = 6 or minlen = 4
Then ctl+o to overwrite, enter to save as current configuration, tap ctl+x to exit.

Then set the new password at the new PIN character length.

2 Likes

This sounds like a far more easier approach. :sweat_smile: :+1:

#Minimum acceptable size for the new password (plus one if
#credits are not disabled which is the default). (See pam_cracklib manual.)
#Cannot be set to lower value than 6.
minlen = 4

The comment gives it away as when I tried to change the password it didn't allow it with a message that reads: BAD PASSWORD: The password is shorter than 6 characters

I think I already tried changing this one before, not sure but it was worth a shot.

I've done this one twice, it didn't work :face_with_diagonal_mouth:

Hmmm, yes, Ubuntu 24.04 did get a lot stricter with security...

I checked and this was a change made in Libpwquality.
However...
ii libpam-pwquality:amd64 1.4.5-3build1 amd64 PAM module to check password strength ii libpwquality1:amd64 1.4.5-3build1 amd64 library for password quality checking and generation
Zorin OS 18 is using 1.4.5 version.
So, here is the thing: I create my PIN at install, which the installation of Zorin OS sets your password directly, not through PAM. I am currently using my 4-digit long PIN on Zorin OS 18.
It does not pull PAM into the picture unless you try changing the password on an already installed system.
On these versions (Not the latest) you can see the BAD PASSWORD: The password is shorter than 6 characters as a warning, not a hard block. It can still accept the 4-digit- pw, but warns that is is shorter than 6 characters.
On later systems, it will reject it entirely.

It's easy enough to try it out again to be sure.

The problem with those old guides is that Linux display managers changed, so the old config files just break the login screen now.

If you don't want to type a long password every time, you could look into a tool called Howdy. It sets up face unlock using your webcam, similar to Windows Hello. It takes a bit of terminal work to install, but it bypasses the password prompt entirely.

Otherwise, we just have to wait until they add a proper PIN feature to the settings, because a lot of people have been asking for it.

Got it :slightly_frowning_face:

I cannot make heads or tails of what you are referring to, here.
You would need to go back to a really old guide - like 2003 range, in order to find issues with PAM configuration and a display manager hack like /etc/pam.d/gdm (though /etc/pam.d/lightdm would work still to this day).

No hacks like those have been referenced in this thread.

It seems you have to use a PIN that's at least 6 digits long with Aravisian's method.
After some trial and error, I managed to set the password e.g. to 123123 or 111222 for a new user during a live session. However, I had to change a few more lines in the file /etc/security/pwquality.conf so that it was accepted (I'm not sure what fixed it, I tried to disable the checks or set values that I want). Not all worked as I wanted, it didn't work with 6 equal ditits, e.g. 111111. Maybe I made something wrong.

With the github guide linked from Swarfendor

it is possible to set a short PIN consisting with entirely of the same digits, e.g. 1111.
I can't test in a live session if you have to enter the normal password at a reboot and the PIN only works afterwards when logging out/suspending/locking the screen. To me it seems with the PIN it takes a bit more time to login until the desktop is loaded.
Edit:
Oh, and I just notice that the password to get sudo rights is not the short PIN.
I would prefer the other method with 6 digits which can be used for first boot, logins and sudo rights.