How to fix ALL USB permission issues on Linux once and for all
On Linux users often have the issue that normal users can’t access some USB devices while root can. Most pages on the internet try to address this issue individually for each device, but most users don’t need that granularity, they just want it to work.
This post provides a method
Installation
Run this in your favourite shell:
wget https://techoverflow.net/scripts/udev-install-usbusers.sh | sudo bash -s $USER
This will print:
SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"
USB device configuration has been installed. Please log out and log back in or reboot
then log out and log back in (or close your SSH session and log back in).
In case this doesn’t work, reboot!
How it works
- It creates a group called
usbusers
- It adds your user (
$USER
) to theusbusers
group. You might need tosudo usermod -a -G usbusers $USER
for additional users that should have access to USB devices! - Then it creates an udev config file
/etc/udev/rules.d/99-usbusers.rules
with the following content:
SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"
- It then tries to reload & trigger udev using
udevadm
. This usually means you don’t have to reboot
In effect, it sets the group to usbusers
for every USB device, no matter what type and ensures the group has write access. This is why this solution is so generic - it’s not limited to a specific type of USB device.