Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to get Ubuntu to lock and unlock itself, if a particular USB stick is attached?

For example; I sit down at my laptop; I plug the USB stick in and the system unlocks and presents itself.

I take the USB stick out, and the system locks and cannot be unlocked without that particular USB stick.

Is there any way to do this, my friends?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I don't know about any products (like Predator for Windows) but I have seen this solution which appears to work:

Use a script to loop&sleep filtering to grep for info specific to your USB stick. When you get a match, kill the screensaver.

Be sure to have the sleep timer a LOT shorter when the USB is removed than when the USB is inserted.

When you are away (USB removed) all your machine has to do is fanatically cycle through lsusb looking for your return (USB inserted).

EDIT: A working example of this to get you on your way can be found at http://www.techienote.com/2011/03/lock-unlock-ubuntu-desktop-using-usb-drive.html

share|improve this answer
1  
Yuck, it would be better to have udev trigger an event on USB insertion/removal that would read someone off the key for verification. –  tgm4883 Sep 22 '11 at 19:55
    
Thank you, my friend! Though I have to say, I was rather hoping there was a simpler, easier program for it... Still, there's nothing like being baptised by fire when it comes to cron :P –  Dante Ashton Sep 24 '11 at 10:48

Pamusb is much easier solution.

links to setup guides:
pamusb setup guide on github.
debian wiki guide on pamusb.

share|improve this answer
    
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Whaaaaaat Sep 27 at 0:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.