aluzzardi / pam_usb

Hardware authentication for Linux using ordinary USB Flash Drives.
GNU General Public License v2.0
151 stars 82 forks source link

pamusb-check fails for correct configuration file #12

Open wuffi opened 11 years ago

wuffi commented 11 years ago

Hi,

On Ubuntu 12.04, I can't get pam_usb to work. My configuration file looks as follows:

<?xml version="1.0" ?>

``` SMI USB DISK a1d8d933-c151-40a9-b930-519210e6d1e9 usbkey gnome-screensaver-command -l gnome-screensaver-command -d ```

This looks correct for me, but "pamusb-check root" gives me: "* No device configured for user "root"."

Could you please hint me towards additional diagnostics to run to pin down the problem.

aluzzardi commented 11 years ago

Hi wuffi,

Could you try with --debug?

Best, Andrea

mcdope commented 10 years ago

I know, old issue. But anyway, for me this was caused by a device without serial - a cheap usb stick. Switched to a stick with serial reported, and it worked. Just wanted to say...

edit: rofl, just (27 nov '16) had this problem again - googled, found my own solution :laughing:

edit2: The culprit is https://github.com/aluzzardi/pam_usb/blob/master/src/conf.c#L174, the !pusb_conf_parse_device(opts, doc) call is returning 0 for devices without serial from https://github.com/aluzzardi/pam_usb/blob/master/src/conf.c#L113. So it seems to be intended behaviour.

edit3: The serial, combined with vendor and model, is used in https://github.com/aluzzardi/pam_usb/blob/master/src/device.c#L35 to check for the device and also in various places in https://github.com/aluzzardi/pam_usb/blob/master/tools/pamusb-agent. Not sure if it's possible to refactor this to UUID checking. I'm to lazy to try, esp. since my python sucks.

gruessung commented 8 years ago

Is it possible to add support for usb stick without serial number? I have the same issue.

mcdope commented 8 years ago

@gruessung I don't think this project is maintained any more, just grab another stick (or other media, I use a microsd on my laptop i.e).