Locking with USB drive
Solution 1
Don't know of any program but you can create a simple script that can do that like in this example:
http://www.techienote.com/2011/03/lock-unlock-ubuntu-desktop-using-usb-drive.html
Solution 2
Well, a module called PAM (Pluggable Authentication module) can be customized to achieve your need. A beautiful article is available on linuxconfig describing this in detail.
The steps are:
-
Install PAM
$ sudo apt-get install pamusb-tools libpam-usb
-
Add USB device to PAM config
$ sudo pamusb-conf --add-device <my-usb-stick>
Select your volume and "Y" to save
-
Define user for PAM auth
$ sudo pamusb-conf --add-user <ubuntu-user>
Select and "Y" to save
-
Configure PAM
$ sudo gedit /etc/pam.d/common-auth
-
Add the line below and save
auth sufficient pam_usb.so
-
Test the PAM auth
$ su ubuntu-user
-
Lock when disconnected
$ sudo gedit /etc/pamusb.conf
-
Modify the block "user" block to look like:
<user id="ubuntu-user"> <device> my-usb-stick </device> <agent event="lock">gnome-screensaver-command -l</agent> <agent event="unlock">gnome-screensaver-command -d</agent> </user>*
cuttlefish could be one solution to do it as @maythux suggested. I really can't comment on its capabilities, I prefer to stay away from 3rd party apps as much as possible.
Related videos on Youtube
Community
Updated on September 18, 2022Comments
-
Community almost 2 years
Possible Duplicate:
Lock and Unlock from USB disk (pendrive)When i use Windows, there is a program I use called Predator that locks my PC when I remove a certain USB flash drive. It then unlocks the computer when I reinsert it.
Is there any program like this for Ubuntu?
-
January almost 12 yearsCan you explain what the program does?
-
SirCharlo almost 12 years@January You don't know about Predator? :O
-
January almost 12 years@SirCharlo I do know about this Predator only; since I hardly ever used Windows, I can hardly know every weird little program for Windows.
-
Admin almost 12 years
-
SirCharlo almost 12 years@January It ain't weird. It's awesome :)
-
Admin almost 12 yearsGUTS GUYS GUYS . i dont want comments about how much predator is good ?
-
January almost 12 yearsWhy would anyone use anything like that? Escapes my comprehension.
-
Admin almost 12 yearsif anyone is lazy to write password so he'll use it :D
-
SirCharlo almost 12 years@January Meh.. Lock and unlock quickly without entering a password.
-
January almost 12 yearsOh, typing deficiency, I get it (it would take me much more time to fumble with a USB stick, dig it out from my trousers pocket, putting it the right way in the USB slot... while typing the password is as good as instant)
-
Admin almost 12 yearsthose are thousands linux guys . and i think only i didnt found it @aking1012
-
pzkpfw almost 12 yearsFull disk encryption with a passphrase stored on a USB stick?
-
-
an offer can't refuse almost 12 yearshow i can find my USB ID ?
-
Branimir Kolar almost 12 yearsIt's explained on that site in terminal "...run lsusb and locate your USB Device..."
-
an offer can't refuse almost 12 yearsis there any recovery when i lost my drive?
-
SirCharlo almost 12 years@EnesKuray Check out my last comment, under your question.
-
Branimir Kolar almost 12 years@EnesKuray you can always enter your password to login to desktop
-
an offer can't refuse almost 12 yearshow can i use 2 device ?