One of the most popular is pam_usb tools, this tool provides, among other things to do:
- Password less authentication, use USB stick for that;
- Two-factor authentication. USB stick and password to authenticate the user.
- Support for all kind of removable devices (SD, MMC, etc);
- It works with any application supporting PAM, such as su, any login manager (GDM, KDM), etc.
First install needed packages:
apt-get install libpam-usb pamusb-toolsConnect the pen drive and add it to any name.
Note: Check if it's only one pen drive connected;
Note2: The data in pen drive is not erased.
pamusb-conf –add-device token
Now add the user account associated to that pen drive.
pamusb-conf –add-user youruserNote: Answer all questions with 'yes'.
Check if all process is done correctly:
pamusb-check youruserIf it says: Access Granted it's all ok.
Finally you must add " auth sufficient pam_usb.so" to file /etc/pam.d/common-auth.
From now you can login with your USB pen drive, but it's not all you can run an script and perform some action...For more information please visit the official page.
