I am using this on 14.04 and it is working. Some things I have noticed:
Only one usb device per username. Otherwise the error "no device found for user 'username'"
I did not change the /etc/pam.d/common-auth
file at all. "ie auth sufficient"
.
Use $ pam-auth-update
instead, unless you are adding events to detect when the usb device is plugged in or disconnected. Be warned, the $ pam-auth-update
command will not work after you manually change the /etc/pam.d/common-auth
file. You will need to manually manage it. pam-auth-update
will force reverting to the default file if run in the future.
Use the following command after plugging in the desired usb device. Change "MyDevice"
to any one word you want. like MyDevice
, Lexar32gb
, Sandisk
, etc.
$ sudo pamusb-conf --add-device MyDevice
Please select the device you wish to add.
* Using "Verbatim STORE N GO (Verbatim_STORE_N_GO_07A10D0894492625-0:0)" (only option)
Which volume would you like to use for storing data ?
0) /dev/sdb2 (UUID: A842-0654)
1) /dev/sdb1 (UUID: CAAF-0882)
[0-1]: 0
Name : MyDevice
Vendor : Verbatim
Model : STORE N GO
Serial : Verbatim_STORE_N_GO_07A10D0894492625-0:0
UUID : A842-0654
Save to /etc/pamusb.conf ?
[Y/n] Y
Done.
Use this command to add the user account you want linked to the device.
$ sudo pamusb-conf --add-user username
Which device would you like to use for authentication ?
* Using "MyDevice" (only option)
User : username
Device : MyDevice
Save to /etc/pamusb.conf ?
[Y/n] y
Done.
After this, Test the functionality by:
This is a successfull test.
$ su username
* pam_usb v0.5.0
* Authentication request for user "username" (su)
* Device "-MyDevice" is connected (good).
* Performing one time pad verification...
* Access granted.
This is a fail.
* pam_usb v0.5.0
* Authentication request for user "username" (su)
* Device "-MyDevice" is not connected.
* Access denied.
Password:
If you get:
* pam_usb v0.5.0
* Authentication request for user "uername" (su)
* Device "-MyDevice" is connected (good).
* Performing one time pad verification...
* pad verification failed (i think this is the error line)
* Access denied.
Password:
Perform a
$ rm ~/.pamusb/*
This will erase the pad file, and running the
$ su username
will force a recreation of the pad file with the correct group and file permissions.
Let me know if this helps.