Upload works as root, but not as user

I am running Arduino 1.8.5 (with all possible updates) on Ubuntu 16.04.

This is my one and only Uno, first time upload.

Upon uploading I keep getting: avrdude: ser_open(): can’t open device “/dev/ttyACHO”: Permission denied

Arduino: 1.8.5 (Linux), Board: "Arduino/Genuino Uno"

Sketch uses 726 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

RXTX was installed through Synaptic. (ver: 2.2pre2-13)

Board info shows: BN: Arduino/Genuino Uno
VID: 2341
PID: 0043

fester@Office-Ubuntu://home/fester/Arduino/arduino-1.8.5$ ls -l /dev/ttyACM
ls: cannot access '/dev/ttyACM': No such file or directory
fester@Office-Ubuntu://home/fester/Arduino/arduino-1.8.5$ lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 003 Device 002: ID 045e:00f6 Microsoft Corp. Comfort Optical Mouse 1000
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
fester@Office-Ubuntu://home/fester/Arduino/arduino-1.8.5$ sudo chmod a+rw /dev/ttyACM0
[sudo] password for fester:
fester@Office-Ubuntu://home/fester/Arduino/arduino-1.8.5$ sudo usermod -a -G dialout fester
fester@Office-Ubuntu://home/fester/Arduino/arduino-1.8.5$ sudo chmod a+rw /dev/ttyACM0
fester@Office-Ubuntu://home/fester/Arduino/arduino-1.8.5$ sudo chown fester /dev/ttyACM*

……..next I tried running as root.

root@Office-Ubuntu:~# ./arduino

Picked up JAVA_TOOL_OPTIONS:

(java:6470): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.9BD7BZ': No such file or directory

(java:6470): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
Sketch uses 726 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

As far as I’m concerned, the upload worked when I was root.

…....then I tried running as a user again and got:

avrdude: ser_open(): can’t open device “/dev/ttyACHO”: Permission denied

Assuming I shouldn’t always be running as root, how do I get the permissions to work when running as a user?

can't open device -dev-ttyACH0 verbose diags.txt (23 KB)

(deleted)

fester@Office-Ubuntu:~$ sudo adduser fester dialout
[sudo] password for fester:
The user fester' is already a member of dialout'.
fester@Office-Ubuntu:~$

...I'm certainly going to add this to my troubleshooting list though.

(deleted)

I already did that towards the bottom of the bottom of the terminal statements.

I'm also being careful to turn off the Arduino program, unplug the board, start the program, then plug in the board again before attempting an upload.

(No offense taken, I'd check too.)

(deleted)

(deleted)

Another useful link for Linux users.

After I get a fix for these kinds of things, I usually feel like an idiot, like I do now.

Fortunately I'm accustomed to the feeling.

GDSports:

The link above, graciously provided by GDSports provided the answer.

After making low level changes in Linux, like group settings, you have to logout, then login again before any of the changes take effect. When you ask Linux, it looks like your changes are already there, but they're not. In many things Linux, you don't need to worry about things like open files so you don't usually have to reboot, login, or whatever. For some kinds of things you do, and this is one of them.

(For all the newbies out there...) Aside from logging out and logging in again, I'm guessing the part that made the difference was;

sudo usermod -a -G dialout fester
sudo chmod a+rw /dev/ttyACHO

If that doesn't do it for you, all the other things I tried are listed above.

THANK YOU EVERYBODY!!!

I, on the other hand, merely exited the Arduino program, unplugged the board, started the Arduino program again, and re-attached the board. The low level Linux setting never got reset until I logged out and logged back in. (I could have done the same thing by shutting down and rebooting.)

(deleted)