Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
Thanks that did the trick! – Saeid87 Nov 20 '12 at 18:38

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.

share|improve this answer

working udev rule:

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

idVendor and idProduct for Atmel AVR Dragon

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.