sábado, 2 de abril de 2011

Log in Linux with an USB Pen Drive

Recently I had the idea in increase the security of my Netbook, so I think if it's possible to keep an user session only if an determinated USB pen drive is plugged. I have made an research and I found that there are already some tools to do that.
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.
 How to install:
 First install needed packages:
apt-get install libpam-usb pamusb-tools
Connect 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 youruser
Note: Answer all questions with 'yes'.

Check if all process is done correctly: 
pamusb-check youruser
If 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.



Sem comentários:

Enviar um comentário