Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

at the moment I use Xubuntu 11.10, my question is: How can I request password when Usb hardware is plugged in?


I plug usb mass storage: now xubuntu open a window and show me files and folders of a usb mass storage. I want that when I plug usb mass storage (or any other usb hardware) ask a "root/sudo" password and after show files and folder or make other operations.

share|improve this question
up vote 2 down vote accepted

For Ubuntu 11.10

  1. Create a .pkla file with the following command.

    gksu gedit /var/lib/polkit-1/localauthority/50-local.d/mount-usb.pkla
  2. Paste the following text into the file's contents, and save the file.

    [Mounting, checking, etc. of external drives]
  3. Logout, and login again.

Source (Ubuntu Forums) I've tested it with two USB drives (one a flash drive, the other an external HDD), and things seem to work perfectly!

share|improve this answer
It's works Thanks!!! Now I have the road to find way to ask authentication for keyboard and mouse connections! Thanks again – user52252 Mar 27 '12 at 10:32

Your Answer


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.