Security: Disable USB Drive mount for Users

If you share your Systems and you want to disable USB Drive connects there is a small solution. By default the gvfs Service handle all automounts and drive scans. On old Linux Systems you could purge the complete gvfsd “Backend” but Ubuntu-Desktop forces some pakets to the default Desktop Package! If you purge it the working Desktop can be destroyed!

It’s easier to disable the “USB Drivers” called Modules from load on Start! Cause Rules are “Software” and can FAIL unknown!!

Howto? Edit the /etc/modprobe.d/blacklist.conf and add:

blacklist usb_storage
blacklist uas

Update initramfs (Kernel Image)

update-initramfs -u -k all
reboot

Now try to plugin USB Sticks , they should now be ignored!

To enable USB Drives temporaily do:

$sudo modprobe uas
$nautilus

Now the USB Stick should be able to mount for root!

Advantage? No gvfs, org.freedesktop rules or package deps are touched!

Remark: On Laptops DISABLE all USB Devices for Security Reasons! There should now “Fake Keyboard” or “Fake Mouse” be able to enter the Systems!!! (USB Kill Sticks)

Impressum Datenschutz-DSGVO-GDPR

www.linuxonlinehelp.eu - Nonprofit Linux PC & Server Support since 2004 Tags: Linux Online Help, Linuxonlinehelp, Linux Support, Linux Hilfe