N
N
nooclik2022-04-02 12:50:35
linux
nooclik, 2022-04-02 12:50:35

Is it possible to restrict access to usb-carriers with exceptions by regular means?

Good afternoon, the task is to block access to usb-carriers, with the exception of a few certain ones, there are no problems with complete blocking, but how to solve with permission for certain ones, let's say by their s / n, using only the standard OS capabilities. Please share if anyone has experience with this configuration.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
rPman, 2022-04-02
@nooclik

Deny access to usb to everyone and write a script that, for example, will check the list of devices using cron, for example, using lsblk (you can configure verbose output there) and look there for the uuid or label or device ID and mount
and to unmount, allow your sudo unmount to run, let users run the shortcut

M
Melkij, 2022-04-02
@melkij

rummage in the direction of udev, for example
https://wiki.gentoo.org/wiki/Allow_only_known_usb_...
https://unix.stackexchange.com/q/63199
Of course, this does not make sense if the user has root rights or the ability to get.

A
Adamos, 2022-04-02
@Adamos

If there are several media and you are ready to steer them manually - I suppose you can just register them by UUID in fstab for automatic mounting. And mounting by the user to forbid.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question