mcc, (edited )
@mcc@mastodon.social avatar

Hey, so, weird Linux question

I ran this script that talks to the serial port https://mastodon.social/@mcc/111270685822595407

It uses PySerial

It only works if I run as root

The device is owned by the "dialout" group, so I added myself to the dialout group— id(1) confirms I'm in the group

But I'm still being denied

What am I missing? I tried logging Wayland out and back in.

Is there something I have to do to like… rehash group privs?

xlerb,

@mcc The group list is part of a process's state (like the uid and primary gid); changing /etc/group won't affect an existing session. That's probably why rebooting fixed it; logging out and back in also would've, or sudo'ing to yourself (like what I did the last time I had to add myself to a group for something and was too lazy to log out), or maybe newgrp.

This is also the difference between id without a username (shows the calling process's actual credentials) and id with a username (shows what creds the user would get if they logged in anew, basically).

mcc,
@mcc@mastodon.social avatar

@xlerb but logging out and back in (either killing and restarting gnome-terminal, or logging the gui out and back in) did not work.

One reply claimed "dialout", among groups, is special in some way. Could this be true?

xlerb,

@mcc …so uh, somehow I completely failed to see the sentence where you said you'd tried that. My sincere apologies for being the online rando who gives bad advice.

I thought I knew all the ways this corner of computer could be broken but maybe someone invented new ones? My guess is that it's not about the dialout group in particular and there's some additional level of user-information cache, like nscd or maybe some new systemd thing, but at this point I'm not sure how much I should trust my intuition here.

eqe, (edited )
@eqe@aleph.land avatar

@mcc @xlerb I've seen selinux and apparmor policies cause inexplicable failures like this, but I haven't had any problems with dialout specifically on ubuntu (I do a lot of ttyUSB access on ubuntu systems). I'm only on 22.04 LTS tho, I think you're on a more recent release...

There might be audit messages in syslog if it's policy related.

I can say, on 22.04 doing usermod -aG dialout , then logging out and back in, suffices for ttyUSB, a reboot is not required. I've done exactly this on at least 4 systems in the last 3 months. If they've added some new hoop on 23 I guess I'll find out soon enough ...

Aradayn,
@Aradayn@mastodon.social avatar

@mcc
Glad you worked it out! By the way, what's PyScripting?

mcc,
@mcc@mastodon.social avatar

@Aradayn Uh… that is a typo. I meant PySerial.

mcc,
@mcc@mastodon.social avatar

OK IDK if it was this or something else but a full system reboot fixed it https://mastodon.social/@violator@mathstodon.xyz/111270794380647946

violator,
@violator@mathstodon.xyz avatar

@mcc last three systems i've had to add users to dialout on, mix of ubuntu and rhel, needed a reboot in order to realize access

MadMike77,
@MadMike77@chaos.social avatar
PiiiepsBrummm,
@PiiiepsBrummm@chaos.social avatar

@MadMike77 @mcc
This image reminds me of a math textbook I own, that was originally placed in the "Belletristik" (fiction) section of the library.

mcc,
@mcc@mastodon.social avatar

@PiiiepsBrummm @MadMike77 thinks Roko's Belletristik

slembcke,
@slembcke@mastodon.gamedev.place avatar

@mcc There’s some command you can run to make the system pick up the change… but I’ve just rebooted the last few times it’s come up since you’ll never find it faster than that. (Shrug)

hyc,
@hyc@mastodon.social avatar

@mcc what did id with no options print out?

pjstevns,

@mcc is /etc/securetty still a thing these days? Waiting to board a plane so hard to check rn.

mcc,
@mcc@mastodon.social avatar

@pjstevns I don't know. I'll check google.

pjstevns,

@mcc File is pretty self explanatory, so vi /etc/securetty might help

violator,
@violator@mathstodon.xyz avatar

@mcc dialout sometimes requires reboot

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • everett
  • osvaldo12
  • magazineikmin
  • thenastyranch
  • rosin
  • normalnudes
  • Youngstown
  • Durango
  • slotface
  • ngwrru68w68
  • kavyap
  • mdbf
  • InstantRegret
  • JUstTest
  • ethstaker
  • GTA5RPClips
  • tacticalgear
  • Leos
  • anitta
  • modclub
  • khanakhh
  • cubers
  • cisconetworking
  • megavids
  • provamag3
  • tester
  • lostlight
  • All magazines