Permission Denied when uploading a program to my Arduino

If you just started playing with Arduino on Linux, you may have run into an error uploading your very first program, similar to the following:


avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Your Arduino is mapped to a character device file called /dev/ttyACM0 and it looks like the IDE does not have permission to write to it. That’s essentially the problem and the fix is simple enough.

Open up a terminal and follow these commands. First let’s figure out what the current permissions are on this file.


ls -lah /dev/ttyACM0

You should get output similar to the following:


crw-rw---- 1 root dialout 166, 0 Feb 28 10:47 /dev/ttyACM0

What this shows us is that the owner (root) has read and write permissions, the group (dialout) has read and write permissions and others have no permissions at all. The fix is to let others have read and write permission so that your IDE can upload the program.


sudo chmod 666 /dev/ttyACM0

As demonic as that permission code looks like, it is actually just giving everyone read and write permission for this file.

If you run the ls command again, you should see that the permissions have changed:


crw-rw-rw- 1 root dialout 166, 0 Feb 28 10:56 /dev/ttyACM0

I don’t know what the user is when the IDE tries to upload, but if you do, please leave a comment!

You should now be good to upload your sketch to your Arduino.

9 thoughts on “Permission Denied when uploading a program to my Arduino

  1. Following the above instructions and the official Arduino instructions don’t work.
    The issue is caused by morons posing as programmers.

    There are TWO Arduino IDE versions
    – Flatpak and
    – Snap otherwise called Arduino_Mhall119.

    The Flatpak version works fine on Mint but does have display issues on KDE and Plasma.
    The display is also faulty on Kubuntu which is Plasma again.
    So one would think to install the Snap version on Plasma.
    The display works but the serial port does not.
    The Snap version works on Xubuntu.

    So I concluded that the KDE programmers have no idea what they are doing.
    Which is not surprising for – I understand – they are using Qt which is, well, not on the top of the task to be polite. (I was to document the bugs I found but my life is not long enough)

    My solution: get away from KDE and Plasma.

  2. Man, I have been trying everything to do this, and followed your instructions to a T, and still it doesn’t work. I have a Toshiba C650 running Ubuntu 16.04 LTS, and have a Arduino Uno, that works perfectly on my iMac, but no matter what I do, I still get the:

    avrdude: ser_open(): can’t open device “/dev/ttyACM0”: Permission denied
    Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

    The arduino turns on, has the yellow light, did the dialout thing, did the chown, the usermod, the 666, everything, but still the above issue.

    Maybe its this crappy Toshiba.

  3. You can also set access permissions for a user, which worked for me:
    > sudo setfacl -m “u:USER:rw” /dev/ttyACM0

    ArchWiki say to add $USER to groups uucp & lock, which didn’t work for me ( error: no group lock found in /etc/groups):
    https://wiki.archlinux.org/index.php/Arduino
    > sudo gpasswd -a $USER uucp

    http://askubuntu.com/questions/112568/how-do-i-allow-a-non-default-user-to-use-serial-device-ttyusb0
    This page points out that the ‘dialout’ group has access to USB ports, so adding $USER should also fix access
    > sudo adduser $USER dialout

    ******** Logoff-on to use the new permissions **********

  4. You can also set access permissions for a user, which worked for me:
    > sudo setfacl -m “u:USER:rw” /dev/ttyACM0

    ArchWiki say to add $USER to groups uucp & lock, which didn’t work for me ( error: no group lock found in /etc/groups):
    https://wiki.archlinux.org/index.php/Arduino
    > sudo gpasswd -a $USER uucp

    http://askubuntu.com/questions/112568/how-do-i-allow-a-non-default-user-to-use-serial-device-ttyusb0
    This page points out that the ‘dialout’ group has access to USB ports, so adding $USER should also fix access
    > sudo adduser $USER dialout

    • Hey sorry for the late reply. In my case the permissions reset when I unplug the board from my PC. Most likely this is due to the fact, that once the device is unplugged, its not mounted any more and reconnecting it remounts it. You could potentially modify the permissions on the parent folder, although I wouldn’t recommend it.

      I can’t see why they would reset while uploading, unless you have that as part of your script. Do you get the same error message? If you’ve found a solution to that, please share it and I’ll gladly update the article (and attribute it to you).

      • i gave up for a while, now i just run the IDE as root when i need to upload. not ideal but it works. i’ll update you when i find a real fix.

What are your thoughts?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s