disabling USB ports

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

disabling USB ports

Postby magfan » Nov 29th, '17, 10:12

How can I disable USB ports for specific users? They should not be able to connect external devices to the system.
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: disabling USB ports

Postby wintpe » Nov 29th, '17, 13:15

its along the same lines as the power management disable of usb ports that i discussed in the basic forum.

viewtopic.php?f=7&t=12136

lsusb, identify what ports you want to disable.

then traverse the /sys filesystem to find all the releated usb modules.

then , as an example, not necessarily an exact solution to your problem.

echo -n "0000:00:12.0" > /sys/bus/pci/drivers/ohci_hcd/unbind

you could add to that , again referring to the other thread a systemd script to run on bootup to add this line.

beware some usb ports may be used for keyboard/mouse.

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: disabling USB ports

Postby magfan » Nov 29th, '17, 14:11

I do not want to disable some USB ports completely. A few users should still be able to use USB ports. Other users like "guest" should not be able to use them.
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: disabling USB ports

Postby doktor5000 » Nov 29th, '17, 19:47

If the device nodes are not tied to a specific system group by default, then you might only be able to distinguish between root and all other users.
See e.g. https://askubuntu.com/questions/887339/ ... untu-16-04
or https://unix.stackexchange.com/question ... n-a-debian

Otherwise you probably need to adapt the default udev rules for all USB devices to make them only accessible for some group that other users are part of but where guest is not a member of.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18017
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest