Say, I have USB drive authentication up and working. So far, so hoopy. But now I want to take the next step, which is locking the machine when I eject the medium. I know there is udev I can script, but it would be really silly if there's a solution out there which I fail to type the right keywords to find.

So the objective is: lock the screen when the key medium is taken out. Optionally, offer to switch user.

In case anyone cares, I use Debian Sid with WindowMaker, adding gnome-settings-daemon to the mix. I have GNOME programs and use them, just not using the DE itself. I hope there is DE/WM-agnostic solution.

„There is no ready-made solution” counts as a valid answer, too.


This was answered over on Ask Ubuntu. The answers there seem like they would work on many *nixes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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