Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] prevent more devices from being added via USB
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
o5gmmob8
Guru
Guru


Joined: 17 Oct 2003
Posts: 583

PostPosted: Tue Mar 18, 2025 4:42 pm    Post subject: [SOLVED] prevent more devices from being added via USB Reply with quote

How would I lock down USB such that after all the devices are plugged in, I can prevent new ones from being added? I would want to prevent any additional kernel modules from being loaded. Would I control that via udev?

I don't want to unload USB entirely, but I'm sure that would work while at the same time, whatever is connected, wouldn't.

EDIT:
I came across this in an old system configuration I had many years ago:

Code:
# by default, do NOT authorize USB devices
for d in $(ls /sys/bus/usb/devices/ | grep "usb.*")
do
   echo 0 > /sys/bus/usb/devices/$d/authorized_default
done


Unforrtunately, I'm not seeing any sort of authorized file.


Last edited by o5gmmob8 on Tue Mar 18, 2025 6:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55179
Location: 56N 3W

PostPosted: Tue Mar 18, 2025 6:22 pm    Post subject: Reply with quote

o5gmmob8,

Code:
$ ls -l /sys/bus/usb/devices/usb1/
total 0
drwxr-xr-x 10 root root     0 Mar 18 18:15 1-0:1.0
drwxr-xr-x  7 root root     0 Mar 18 18:19 1-4
drwxr-xr-x  6 root root     0 Mar 18 18:15 1-5
-rw-r--r--  1 root root  4096 Mar 18 18:16 authorized
-rw-r--r--  1 root root  4096 Mar 18 18:16 authorized_default
...

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
o5gmmob8
Guru
Guru


Joined: 17 Oct 2003
Posts: 583

PostPosted: Tue Mar 18, 2025 6:58 pm    Post subject: Reply with quote

Oh, yes, you're right, hmm, I need to play around more with find then.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum