1

I am working with some USB and Serial micro-controllers. Everytime I plug a device I have to do the following command to give it write access, and also my password:

sudo chmod 666 /dev/ttyUSB0

Can I set my Ubuntu to automatically give write access to pluged in devices?

If not, how can I make a batch file that I can easily give the access to port I want for example if I run the following command it does the job:

giveaccess -usb0
Dumbo
  • 1,912

3 Answers3

4

You should add your userid to the dialout group. Suppose your userid is joeuser, then do:

sudo adduser joeuser dialout

and then log out and log back in again for this to take effect.

0

You can do this by configuring udev in /etc/udev/rules.d. There should be a README file right there for you to read first.

It should be pretty straightforward. More about this can be read for example here: "Writing udev rules".

An example:

SUBSYSTEM=="usb", SYSFS{idVendor}=="0123", SYSFS{idProduct}=="4567", ACTION=="add", GROUP="audio", MODE="0666"

would give an USB device of vendor id 0123 and product id 4567 the group audio and a file mode of 0666 when added to the system.

gertvdijk
  • 67,947
0

working udev rule:

SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107",GROUP="dialout", MODE="0666"

idVendor and idProduct for Atmel AVR Dragon

zajc3w
  • 131
  • 1
  • 4