I have an unstable usb-device that needs to be reset every five minutes. So far, I manually unplugged it which is rather annoying. I found out that it's possible to reactivate it by unbinding/rebinding, so that it can be rescued by this script: (I can parse the path from lsusb -t)

echo '1-1' > /sys/bus/usb/drivers/usb/unbind
echo '1-1' > /sys/bus/usb/drivers/usb/bind

This script can onlty be executed by root, but I'd like to integrate the calls into my application (C++ binary). Running everything as su sounds like an overkill and I hope that there is something like a group that has this ability.

1 Answer 1


To give the user "foo" root privileges via the sudo command, edit /etc/sudoers and add the line:


See sudo(8) and sudoers(5) for more information.

For bind/unbind you can use below command:

echo -n devicePath > /sys/bus/usb/drivers/usb/unbind
echo -n devicePath > /sys/bus/usb/drivers/usb/bind

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .