LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How to block USB except Data Card (https://www.linuxquestions.org/questions/debian-26/how-to-block-usb-except-data-card-4175504304/)

akhilesh_03 05-08-2014 02:35 AM

How to block USB except Data Card
 
Hi all,

How to block USB(storage devices only)in UBUNTU 12.04 but It should allow Data Card for the Internet access ??

Is there any way to do this ??

Thanks

rtmistler 05-08-2014 07:10 AM

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.

jefro 05-08-2014 08:00 PM

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.

rtmistler 05-09-2014 07:37 AM

Close but not exactly.

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.

jefro 05-09-2014 08:18 PM

http://askubuntu.com/questions/23003...ad-of-the-user

Reverse that.


https://help.ubuntu.com/community/Mo...ser_Privileges

Remove that.

akhilesh_03 05-13-2014 12:35 AM

Hi,

Thank you all for your reply.

Thanks


All times are GMT -5. The time now is 08:51 PM.