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.

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

Example:

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

1 Answer 1

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]
    Identity=unix-group:admin
    Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.filesystem-check;org.freedesktop.udisks.filesystem-unmount-others;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.change;org.freedesktop.udisks.luks-unlock
    ResultActive=auth_admin_keep
    
  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

 
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.