Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to get Howdy to start authentication at system start with Ubuntu 24.04 #927

Open
betzburger opened this issue Jun 5, 2024 · 10 comments

Comments

@betzburger
Copy link

betzburger commented Jun 5, 2024

I really need help. I am very frustrated.
Ubuntu 24.04 and Howdy is a major pain in the ass for me.
I use the release version 2.6.1 and I use Ubuntu 24.04 with all updates and upgrades until today.

This is what I did so far:

sudo add-apt-repository ppa:boltgolt/howdy
sudo apt update
sudo apt install howdy

But I got error: externally-managed-environment ... bla bla ...

I had to do

sudo apt install python3-requests 
or 
sudo apt install howdy (again) 

Then it installed some more files and said it has finished.
Yes! (so I thought)
I tried to start howdy, but no howdy was found

sudo ln /lib/security/howdy/cli.py /usr/local/bin/howdy fixed this issue.

I tried to start howdy again, but unfortunately I was welcomed with ModuleNotFoundError: No module named 'cli'

Well, I did sudo nano /usr/lib/security/howdy/cli.py and I added

sys.path.append('/lib/security/howdy') in cli.py after import sys

Fixed!!

But then - really??!! - I got ModuleNotFoundError: No module named 'dlib'

I had to do sudo pip install dlib --break-system-packages to overcome this.
I hated to possibly break system packages but it seemed there was no other way.

Finally I called sudo howdy config and added the correct path to the video device

sudo howdy add worked fine and it added my face

sudo howdy test worked. However, my face had a red circle. Don't know if this is an issue.

I checked sudo-pam-auth-update and howdy is selected. OK.

I checked sudo nano /etc/pam.d/common-auth and this is inside:

# here are the per-package modules (the "Primary" block)
auth    [success=3 default=ignore]        pam_python.so /lib/security/howdy/pam.py
auth    [success=2 default=ignore]      pam_unix.so nullok try_first_pass
auth    [success=1 default=ignore]      pam_sss.so use_first_pass

Looks good.

Someone said you have to: sudo chmod -R a+x /lib/security/howdy which I did.
(Not sure if this is necessary, but it won't hurt)

I checked the log file and sudo cat /var/log/auth.log said that there is an issue with ConfigParser

So I patched /usr/lib/security/howdy/pam.py like this:

@@ -6,11 +6,17 @@ import os
 import glob
 import syslog
 
import sys
# The config parser is named in python2 as ConfigParser but in python3 as configparser
# and here is a workaround for this.
if sys.version_info[0] == 2:
    import ConfigParser
    config = ConfigParser.ConfigParser()
else:
    import configparser
    config = configparser.ConfigParser()
 
 # Read config from disk
 config.read(os.path.dirname(os.path.abspath(__file__)) + "/config.ini")

And now ladies and gentlemen I am at the end of my capabilities.
Howdy does not start at login and I still have to manually enter my password.

Any other ideas?

@meetnick
Copy link

meetnick commented Jun 7, 2024

Im sorry my comment won't be useful, I just want to say I just came to this repo to open the exact same issue I'm facing with Ubuntu 24.04. I'm also very frustrated. I can add and test face, but I'm not able to make it work when typing sudo nor in login screen (gdm).

@betzburger
Copy link
Author

Now it works.

I have a Laptop with the lid closed.
I entered sudo config howdy and changed the following entry to this:

# Disable Howdy if lid is closed
ignore_closed_lid = false

By default it was set to true.
And - yeah - one should think that if set to "true" it is correct.
Well, set it to "false" and now Howdy is NOT disabled with closed lid.

@SprintKeyz
Copy link

This worked for me as well! Thank you for sharing. Since I'm on a fresh install, I also had to install numpy and opencv:

sudo apt install python3-numpy and sudo pip install opencv-python --break-system-packages

Then I got an indentation error in /usr/lib/security/howdy/pam.py because I was lazy and copy-pasted without fixing indentation.

I also had to add sys.path.append('/usr/local/lib/python3.12/dist-packages) to my cli.py for opencv, obviously for anyone else you just need to replace with your dist-packages location.

Finally, I edited /lib/security/howdy/compare.py to use datetime.datetime.now(datetime.UTC) to remove a warning.

Moral of the story is that if anything goes wrong, /var/log/auth.log is your friend :)

@betzburger
Copy link
Author

Thanks for the additional step by step instructions. This is how it should be. I think we now have a very good overview and help for anyone who has the same issue.

@nicolasb1607
Copy link

Thank you so much! It has fixed my issue on my Dell xps 9500

@luyanfeng
Copy link

luyanfeng commented Jun 13, 2024

I checked the log file and sudo cat /var/log/auth.log said that there is an issue with ConfigParser

So I patched /usr/lib/security/howdy/pam.py like this:

@@ -6,11 +6,17 @@ import os
 import glob
 import syslog
 
import sys
# The config parser is named in python2 as ConfigParser but in python3 as configparser
# and here is a workaround for this.
if sys.version_info[0] == 2:
    import ConfigParser
    config = ConfigParser.ConfigParser()
else:
    import configparser
    config = configparser.ConfigParser()
 
 # Read config from disk
 config.read(os.path.dirname(os.path.abspath(__file__)) + "/config.ini")

这里我按你的做了也不行,
但配置了下这个文件就可以了, /etc/pam.d/common-auth:

auth [success=3 default=ignore] pam_python.so /lib/security/howdy/pam.py

启动登陆和shell下的sudo 都可以用了。
不同的是,我安装howdy时这么做的:

sudo mv /usr/lib/python3.12/EXTERNALLY-MANAGED /usr/lib/python3.12/EXTERNALLY-MANAGED.BAK  

(安装完howdy后我又改回去了)

看能不能帮到你
image

@Nulldev128
Copy link

Thanks for the great advice, followed it all & ended up with the issue:

sudo howdy test

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

I found numpy 2.0.0 released yesterday...

The fix I found was:

sudo pip3 uninstall numpy
sudo pip3 install numpy==1.26.4

@l3ifk
Copy link

l3ifk commented Jun 19, 2024

Im sorry my comment won't be useful, I just want to say I just came to this repo to open the exact same issue I'm facing with Ubuntu 24.04. I'm also very frustrated. I can add and test face, but I'm not able to make it work when typing sudo nor in login screen (gdm).

Did you try the workaround for the ConfigParser Error? Howdy didn't work for me too on a fresh Ubuntu 24 install and after the configparser fix it tried to use the face recognition. Also make sure to add a face model (obvious I know but I just wanted to make sure you don't forget it)

@SWi7CHbladE
Copy link

I really need help. I am very frustrated. Ubuntu 24.04 and Howdy is a major pain in the ass for me. I use the release version 2.6.1 and I use Ubuntu 24.04 with all updates and upgrades until today.

This is what I did so far:

sudo add-apt-repository ppa:boltgolt/howdy
sudo apt update
sudo apt install howdy

But I got error: externally-managed-environment ... bla bla ...

I had to do

sudo apt install python3-requests 
or 
sudo apt install howdy (again) 

Then it installed some more files and said it has finished. Yes! (so I thought) I tried to start howdy, but no howdy was found

sudo ln /lib/security/howdy/cli.py /usr/local/bin/howdy fixed this issue.

I tried to start howdy again, but unfortunately I was welcomed with ModuleNotFoundError: No module named 'cli'

Well, I did sudo nano /usr/lib/security/howdy/cli.py and I added

sys.path.append('/lib/security/howdy') in cli.py after import sys

Fixed!!

But then - really??!! - I got ModuleNotFoundError: No module named 'dlib'

I had to do sudo pip install dlib --break-system-packages to overcome this. I hated to possibly break system packages but it seemed there was no other way.

Finally I called sudo howdy config and added the correct path to the video device

sudo howdy add worked fine and it added my face

sudo howdy test worked. However, my face had a red circle. Don't know if this is an issue.

I checked sudo-pam-auth-update and howdy is selected. OK.

I checked sudo nano /etc/pam.d/common-auth and this is inside:

# here are the per-package modules (the "Primary" block)
auth    [success=3 default=ignore]        pam_python.so /lib/security/howdy/pam.py
auth    [success=2 default=ignore]      pam_unix.so nullok try_first_pass
auth    [success=1 default=ignore]      pam_sss.so use_first_pass

Looks good.

Someone said you have to: sudo chmod -R a+x /lib/security/howdy which I did. (Not sure if this is necessary, but it won't hurt)

I checked the log file and sudo cat /var/log/auth.log said that there is an issue with ConfigParser

So I patched /usr/lib/security/howdy/pam.py like this:

@@ -6,11 +6,17 @@ import os
 import glob
 import syslog
 
import sys
# The config parser is named in python2 as ConfigParser but in python3 as configparser
# and here is a workaround for this.
if sys.version_info[0] == 2:
    import ConfigParser
    config = ConfigParser.ConfigParser()
else:
    import configparser
    config = configparser.ConfigParser()
 
 # Read config from disk
 config.read(os.path.dirname(os.path.abspath(__file__)) + "/config.ini")

And now ladies and gentlemen I am at the end of my capabilities. Howdy does not start at login and I still have to manually enter my password.

Any other ideas?

I was able to get Howdy running for login screens and console login using this method, thing is I add the line "auth
sufficient pam_python.so /usr/lib/security/howdy/pam.py" to all the files in /etc/pam.d/ which contain parameters for authentication. I am still not able to use Howdy authentication for snap store and I get an extra "Unlock Keyring" prompt whenever I cold boot my laptop.

@l3ifk
Copy link

l3ifk commented Jun 25, 2024

I was able to get Howdy running for login screens and console login using this method, thing is I add the line "auth
sufficient pam_python.so /usr/lib/security/howdy/pam.py" to all the files in /etc/pam.d/ which contain parameters for authentication. I am still not able to use Howdy authentication for snap store and I get an extra "Unlock Keyring" prompt whenever I cold boot my laptop.

The Keyring prompt has nothing to do with howdy. It pops up because passwords which got saved in the keyring are protected with a password. And usually by logging in with your password this keyring does get unlocked automatically, but since you don't enter any password with howdy the keyring remains locked. You can either set the password to nothing or just type the password one time each session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants