DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I believe you will have to rebuild the Ubuntu 12.04 kernel and remove any options for USB data storage devices. Plus also make sure that no shared library modules are available on the system which serve that same purpose.
I'd agree at first thought about what rtmistler suggested. It should stop it completely.
I do wonder if user permissions could be configured to do that too. Some distro's offer a greater degree of permissions. I think one is mounting usb drives.
In thinking about jefro's comment I did some minor research. I have 12.04 at another location and the system I'm working with now has 10.04. (Yeah I know, VERY outdated version!)
Looking at the groups for a user, there wasn't anything obvious, like a "mount" group. And of course there are a lot of groups so learning the exact description of anything that may be close would be a little tough.
Under the user settings management UI they have an Advanced tab and specifically in there (Again for 10.04) there's a checkbox under the User Privileges tab which says "Access external storage devices automatically"; however that would mean auto-mounting; right? Not restricting the user from being able to mount. There are a variety of other options, but I don't see one specifically for that. I think if one were to un-check that particular property, it would merely mean that the user could mount a USB drive, they just would not see it auto-mount for them. Which is weird. I suppose back in the day when you had to mount everything and before auto-mounting became the norm; it might annoy someone who was used to always doing the actions to have the system jump ahead of them. And yes I can see some cases where a person does not want the drive mounted because their intentions are to do something advanced with it and as a result they'd have to umount to reverse the system's automatic actions.
Either case 12.04 may not have this property, it further does not appear to be exactly what you were seeking.
To make it worse, I'm also wondering if you wished to block per user, but allow root to mount a USB drive. And that would be a natural choice, but worse of a situation because the tactic of not compiling in the driver would be universal for all users, including root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.