@@ -124,8 +124,6 @@ on port 2 (`-p 2`). Supported actions are `off`/`on`/`cycle` (or `0`/`1`/`2`).
124
124
` cycle ` means turn power off, wait some delay (configurable with ` -d ` ) and turn it back on.
125
125
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 ` .
126
126
127
- On Linux, you may need to run it with ` sudo ` , or to configure ` udev ` USB permissions.
128
-
129
127
If you have more than one smart USB hub connected, you should choose
130
128
specific hub to control using ` -l ` (location) parameter.
131
129
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
135
133
USB device into the same physical USB port (this method is also used in Linux kernel).
136
134
137
135
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
+
138
159
Notable projects using uhubctl
139
160
==============================
140
161
| Project | Description |
0 commit comments