I am trying to add an existing user to dialout group but the operations are failing .
Here are the commands I have tried so -far
admin@localhost:~$ sudo adduser admin dialout
[sudo] password for admin:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "en_US.UTF-8",
LC_CTYPE = "UTF-8",
LANG = "C.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("C.UTF-8").
Adding user `admin' to group `dialout' ...
Adding user admin to group dialout
gpasswd: cannot lock /etc/group; try again later.
adduser: `/usr/bin/gpasswd -a admin dialout' returned error code 1. Exiting.
admin@localhost:~$ sudo usermod -a -G dialout admin
usermod: /etc/group.22816: Read-only file system
usermod: cannot lock /etc/group; try again later.
I would like to access USB ports on the device I am working with, which
belongs to dialout group. I have no control on what devices are going to
be connected on to these ports.
@ogra Yes, they are defined in the gadget. I could access the devices connected to serial ports with out any issues after adding them to the gadget but the USB is still no accessbile. @jdstrand , I am running the app as a system daemon and I use sudo whenever I need to use the app as standalone. I will through the article you have shared. Thanks
Unfortunately there are quite a few devices that are not covered either because there isn’t a uaccess rule for it (eg, a serial-port) or because the rules don’t apply for some reason (logging in via ssh and accessing /dev/video* or /dev/snd/* (seat rules don’t apply cause not local)).
to add a user to a system group you need to append the username to the respecive group line in /etc/group … extrausers only helps with non-system groups, so no it would not help since /etc/groups is inside the core snap (readonly squashfs).
Yes but that is only if you aren’t using sudo, but you said you are using sudo, and you have apparmor denials for the device access, so while that topic will be potentially interseting for you once you work out how to setup the gadget, etc, right now you need to get the interfaces setup right for your device (which is what @ogra is helping you with).
Ok, coming back to gadget, should the path for usb slots mentioned in a particular pattern ? I have the path as /dev/ttyUSB0 and so on. I was going through this article and it was mentioned to follow /dev/serial-port-<whatever> pattern.
hmm, why doesnt the same pattern-matching apply if i plainly use the serial-port interface as is ? weird … (i can definitely use /dev/ttyS0 (without vendor and product) on a normal serial port)