Add groups to get access to ttyS* and loopback devices

I tried that, it doesn’t work for the reasons explained by @pramodvu1502 above.

The problem is there is no server - the apps I’m going to use are very low-level and know nothing about Polkit:

  • minicom/picocom/etc. terminal emulator for accessing ttyS* serial tty’s.
  • losetup for managing loopback devices.

Trying to force them to work with Polkit is just wrong, there is no easy way for that.

For Fedora SB, this is the only option for now, indeed.

But since Etc group members by cgwalters · Pull Request #50 · coreos/rpm-ostree · GitHub, there is new etc-group-members option for a “treefile” allowing to do it at the distro build (install?) time, and I see no risks here:
rpm-ostree/docs/treefile.md at 18911fece32d9fa7a71282952fbb1406038cc338 · coreos/rpm-ostree · GitHub

  • etc-group-members: Array of strings, optional: Unix groups in this
    list will be stored in /etc/group instead of /usr/lib/group. Use
    this option for groups for which humans should be a member.

This is what I suggested here.

I just don’t know where the “treefile” resides for SB, any advise?

The only thing you can do with polkit is to start your program with pkexec to make it run as superuser. Or you could use sudo for the same purpose. In would not recommend to do this, as this would give minicom too much privileges.

So, IMHO, the best solution is to make your user id a member of the dialout group.

It is also possible to use the set-gid bit on the program file like this.

  sudo chown root:dialout progname
  sudo chmod 0 progname
  sudo chmod ug+rx progname
  sudo chmod g+s progname

This would make the program itself run with dialout group. This was used many years agou with the uucp programs to access the dial-out modems.

I created a PR to address this: