V
V
vanyok7462015-12-01 11:38:44
linux
vanyok746, 2015-12-01 11:38:44

How to disable auto-mounting of media devices in Ubuntu?

Good afternoon!
There is a task: It is necessary to block the auto-mounting of any USB devices (except for headphones, keyboard and mouse). those. you need to make it so that users cannot connect flash drives, phones, cameras ...
Problem:
I managed to block access to flash drives, but when connecting phones, cameras, devices are recognized as digital, and files can be dumped on them.
What I tried:
1) chmo 700 /medi - blocked access to flash drives
2) in gconf
gsettings set org.gnome.desktop.media-handling automount-open false
gsettings set org.gnome.desktop.media-handling automount false
Does not solve the problem
3) I don't really want to try through hal.
4) Through plugdev and /etc/modprobe.d/blacklist .conf does not solve the problem

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Moseychuk, 2015-12-01
@vanyok746

I don't really want to try through hal.
He's been gone for 7 years now. Read about udev rules. Solved in one line.

V
vanyok746, 2015-12-02
@vanyok746

Happened.
Through udev, I looked where the devices are mounted (/dev/bus/usb)
and gave the rights to the chmod 700 /dev/bus/usb directory. This is the easiest option
. You can also use udev rules, but first you need to figure out how to write them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question