Skip to content

Commit c237ec1

Browse files
committed
Add explanation how to configure Linux USB udev permissions
1 parent 1773ac2 commit c237ec1

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ on port 2 (`-p 2`). Supported actions are `off`/`on`/`cycle` (or `0`/`1`/`2`).
124124
`cycle` means turn power off, wait some delay (configurable with `-d`) and turn it back on.
125125
Ports can be comma separated list, and may use `-` for ranges e.g. `2`, or `2,4`, or `2-5`, or `1-2,5-8`.
126126

127-
On Linux, you may need to run it with `sudo`, or to configure `udev` USB permissions.
128-
129127
If you have more than one smart USB hub connected, you should choose
130128
specific hub to control using `-l` (location) parameter.
131129
To find hub locations, simply run `uhubctl` without any parameters.
@@ -135,6 +133,29 @@ This address is semi-stable - it will not change if you unplug/replug (or turn o
135133
USB device into the same physical USB port (this method is also used in Linux kernel).
136134

137135

136+
Linux USB permissions
137+
=====================
138+
139+
On Linux, you should configure `udev` USB permissions (otherwise you will have to run it as root using `sudo uhubctl`).
140+
To fix USB permissions, first run `sudo uhubctl` and note all `vid:pid` for hubs you need to control.
141+
Then, add one or more udev rules like below to file `/etc/udev/rules.d/52-usb.rules` (replace with your vendor id):
142+
143+
SUBSYSTEM=="usb", ATTR{idVendor}=="2001", MODE="0666"
144+
145+
If you don't like wide open mode `0666`, you can restrict access by group like this:
146+
147+
SUBSYSTEM=="usb", ATTR{idVendor}=="2001", MODE="0664", GROUP="dialout"
148+
149+
and then add permitted users to `dialout` group:
150+
151+
sudo usermod -a -G dialout $USER
152+
153+
For your `udev` rule changes to take effect, reboot or run:
154+
155+
sudo udevadm trigger --attr-match=subsystem=usb
156+
157+
158+
138159
Notable projects using uhubctl
139160
==============================
140161
| Project | Description |

0 commit comments

Comments
 (0)