Distribution: Fedora Linux 44 (Workstation Edition)

I created a new Linux user and gave it admin with the gui interface, I then switched to it, but could not run sudo commands.

So I entered sudo usermod -a -G wheel [USER] to grant sudo rights through the cli, but still, the new user could not use sudo.

I logged in and out multiple times, but it did not help.

Then I restarted Linux and suddenly the new user could use sudo.

To test if it was now working, I striped sudo rights from the new user. But then I realized that the new user could still use sudo.

So it seems that sudo privileges only update on operating system restart? Is this correct, or is something wrong with my system?

Sorry if this is a stupid post

  • Remy@lemmy.todayOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    7 days ago

    Can someone say me if I can let it be that way if I’m ok with rebooting for sudo permission changes or if its necessary to fix this?

  • CameronDev@programming.dev
    link
    fedilink
    English
    arrow-up
    15
    ·
    7 days ago

    Normally groups update at login, so logging in and out should have done it. When your logged in, groups should give you your active groups.

    • Remy@lemmy.todayOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 days ago

      I tried logging in and out multiple times, for the case that user switching doesn’t count as re-login.

      • CameronDev@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 days ago

        Yeah, thats very weird. I dunno if that is some new quirk, but it definitely sounds wrong. You can also cat /etc/groups to see what groups a user has been added to, maybe something was preventing that file being updated?

        • Remy@lemmy.todayOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          7 days ago

          You can also cat /etc/groups to see what groups a user has been added to, maybe something was preventing that file being updated?

          Is there a difference to group [Username] ?

          Do you think that its necesary for me to fix this, or could I just accept that its that way and I need to reboot if I change permissions?

          • CameronDev@programming.dev
            link
            fedilink
            English
            arrow-up
            2
            ·
            7 days ago

            Not sure if there is a difference, might have to check the man page.

            groups gives you your current active groups for your current session. /etc/groups will give you the groups that you get for the next session. Not sure about group username, might be the same.

            Its weird, but given you won’t be changing groups for users frequently, I don’t think I would bother fixing it. Maybe Fedora changed something recently so this is how it is now? I would just forget about it.

            • Remy@lemmy.todayOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              7 days ago

              Ok,

              My plan was just to make a “admin” user that has admin and sudo rights and then remove admin/sudo from my main user.

                • Remy@lemmy.todayOP
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  6 days ago

                  So that I be able to use Gnome Parental Control to regulate my self. Especially in the way of bedtime enforcement

  • twinnie@feddit.uk
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    7 days ago

    I would expect this to get set on login but maybe it’s some systemd quirk.

    • Remy@lemmy.todayOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 days ago

      I tried this with newgrp wheel but still the new user don’t update its privileges