I somehow managed to remove myself from the "wheel" group and can't sudo now
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2019
    Location
    Silicon Valley
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question I somehow managed to remove myself from the "wheel" group and can't sudo now

    I just did a fresh install of Fedora 30 on my Athlon system with 8 GB RAM 1 TB HD etc. relatively low spec GIgabyte motherboard.

    I'm trying to follow the directions for the "Planet CCRMA" package so I can try out some audio programs.

    http://ccrma.stanford.edu/planetccrm...00000000000000

    At first everything set up fine. I ran some programs and noticed they were a little glitchy, but that might be expected as I have not yet installed the low latency kernel. I used the command line at first to join the "jackuser" group which allows use of the low latency feature.

    sudo usermod -a -G jackuser USERNAME

    I'm not exactly sure what happened. At first, my groups were <myusername> and wheel. Somewhere along the line I did a reboot, and now my groups are <myusername> and "jackuser" and "wheel" is gone. I can no longer run any commands like sudo or "su -" and as far as I can tell I am stuck. I didn't lose anything so far except a few hours of time, so it's no great shakes to reinstall but how/why did I get into this particular corner and how do I make sure it doesn't happen again?

    Or, (preferably) is there a way to recover without reinstalling? I did some reboots to the GRUB menu and was unable to determine that any of the options there would lead me towards a recovery path.
    Last edited by Digital Larry; 4th September 2019 at 12:39 PM.

  2. #2
    Join Date
    Jan 2010
    Posts
    7,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I somehow managed to remove myself from the "wheel" group and can't sudo now

    The obvious question, during install, did you create a root user, and if so, do you remember the password? Grouchy old man grumbling, but this is what happens as they the gap between sysadmins and developers widens.

    https://fedoramagazine.org/reset-root-password-fedora/

    That's from April 2018, but seems like it should still work. If you can do that, log on as root in text mode and then you can add yourself to wheel group. I know you said that what you saw online didn't help, but hopefully that will work. Looks like Fedora has trouble adding user to group unless you remove sssd.

    https://bugzilla.redhat.com/show_bug.cgi?id=1659656

    I am in a FreeBSD shop these days so don't have a Fedora install to really test--a quick usermod -a -G gave me an sssd error message.
    Not sure if any of this information is useful to you.

  3. #3
    Join Date
    Sep 2019
    Location
    Silicon Valley
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I somehow managed to remove myself from the "wheel" group and can't sudo now

    Quote Originally Posted by smr54
    The obvious question, during install, did you create a root user, and if so, do you remember the password? Grouchy old man grumbling, but this is what happens as they the gap between sysadmins and developers widens.

    https://fedoramagazine.org/reset-root-password-fedora/
    I did NOT do that, thanks. I will explore this afternoon when I return from work.

    FYI here is my bash history from the beginning of time on this system. At the risk of embarrassing myself, you can clearly see I am searching around without really knowing what I'm doing.

    1 rpm -Uvh http://ccrma.stanford.edu/planetccrm...rma.noarch.rpm
    2 sudo rpm -Uvh http://ccrma.stanford.edu/planetccrm...rma.noarch.rpm
    3 yum upgrade
    4 sudo yum upgrade
    5 sudo rpm -Uvh http://ccrma.stanford.edu/planetccrm...rma.noarch.rpm
    6 usermod -a -G jackuser $(whoami)
    7 sudo yum install ardour
    8 sudo yum install sooperlooper
    9 sudo yum install hydrogen
    10 qjackctl
    11 top
    12 df
    13 sudo yum install audacity
    14 audacity
    15 ls
    16 cd Down
    17 cd Downloads/
    18 ls
    19 gunzip ardour-5.12.tar.gz
    20 ls
    21 tar xvf ardour-5.12.tar
    22 cd ardour-5.12/
    23 ls
    24 cat README-GITHUB.txt
    25 exit
    26 ps ax | grep loop
    27 sudo kill 2481
    28 exit
    29 top
    30 groups
    31 addgroup jackuser
    32 groups add jackuser
    33 group add jackuser
    34 groups
    35 groups -h
    36 groups --help
    37 groups <myusername>
    38 sudo groups
    39 sudo addgroup jackuser
    40 su groupadd jackuser
    41 su -; groupadd jackuser
    42 su -
    43 sudo usermod -G jackuser <myusername>
    44 groups
    45 sudo groups
    46 sudo su
    47 groups
    48 whoami
    49 system-config-users
    [trying to follow outdated instructions from the CCRMA page, which don't correspond to Fedora 30]
    50 sudo yum install system-config-users
    51 system-config-users
    [came back with username "Administrator" and my password didn't work]
    52 sudo system-config-users
    53 sudo yum install planetccrma-core
    54 yum install planetccrma-core
    55 sudo su
    56 exit
    57 whoami
    58 yum install pd-extended
    59 sudo yum install pd-extended
    [by this time, sudo is no longer working]
    60 reboot
    61 sudo yum install pd-extended
    62 users
    63 sudo passwd root
    64 groups
    65 sudo usermod -aG wheel <myusername>
    [this is a copy/paste error, it should have been: sudo usermod -a -G wheel <myusername>
    66 vi /etc/sudoers
    67 chage <myusername>
    68 sudo chage <myusername>
    69 exit
    70 groups
    71 sudo su
    72 vi /etc/default/grub
    73 exit
    74 groups
    75 sudo su
    76 logout
    77 exit
    78 groups
    79 history
    Last edited by Digital Larry; 4th September 2019 at 02:19 PM.

  4. #4
    Join Date
    Sep 2019
    Location
    Silicon Valley
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I somehow managed to remove myself from the "wheel" group and can't sudo now

    This seems to be clearly where I went wrong:

    sudo usermod -G jackuser <myusername>

    should have been:

    sudo usermod -a -G jackuser <myusername>

  5. #5
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    6,226
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: I somehow managed to remove myself from the "wheel" group and can't sudo now

    Hi Digital Larry

    Are you comfortable with using the vi or other command line editor. If so
    log in as root
    or on the command line, enter
    su -
    then vi /etc/group
    Search for the line with wheel.
    at the end of the text, add a colon and your name as it appears in the /home
    wheel:x:489:leslie is my wheel group entry. for example.
    Save the file
    You are now in the wheel group.

    next

    from the command line and still as root enter:
    visudo
    The lines with # are comment lines
    remove the leading # from the line that looks like
    #%wheel ALL=(ALL) NOPASSWD: ALL
    Save the file and log out and then log back in.
    test from the command line
    sudo su

    If you were successful, then you are the administrator and have root privileges.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  6. #6
    Join Date
    Sep 2019
    Location
    Silicon Valley
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I somehow managed to remove myself from the "wheel" group and can't sudo now

    thanks, in spite of my obviously stupid error I have been using Linux and vi for many years... will report back later.

    DL

  7. #7
    Join Date
    Sep 2019
    Location
    Silicon Valley
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I somehow managed to remove myself from the "wheel" group and can't sudo now

    Hi smr54 and lsatenstein, thanks to you I am back in action!

    Once I got to root login I just used the usermod command to add wheel back to my user account.

    Thanks again, you saved me tons of time.

    DL

  8. #8
    Join Date
    Jan 2010
    Posts
    7,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I somehow managed to remove myself from the "wheel" group and can't sudo now

    It's not your stupid error, stuff happens. Most of us have done worse.
    Changes to make it more difficult to fix have also taken place, such as making it more difficult to boot into single user mode--and that process seems to have changed again. There is an advantage to creating a root user though, as it can be used to fix errors like this. On the downside, it's another method of attack, but just about every unix or unixlike system has it, and a good password, prohibiting root ssh login (RedHat does allow ssh login by default), and various other security 101 methods can mitigate the vulnerabilty.

Similar Threads

  1. Possible to do sudo command without user being in wheel group
    By Sprinterdriver in forum Using Fedora
    Replies: 6
    Last Post: 21st August 2019, 10:47 AM
  2. Remove "recovery kernel" & "System setup" from grub2
    By fedup4ever in forum Using Fedora
    Replies: 0
    Last Post: 25th July 2019, 09:03 AM
  3. [SOLVED]
    sudo does not work as expected for users in the wheel group
    By esok in forum Using Fedora
    Replies: 3
    Last Post: 7th March 2018, 03:09 PM
  4. [SOLVED]
    I'm in the wheel group, sudoers allows wheel, but I can't sudo
    By futuremonkey in forum Using Fedora
    Replies: 8
    Last Post: 31st July 2011, 04:31 AM
  5. [SOLVED]
    "yum" cannot access mirror sites but "Add/Remove Software" can.
    By feimingchen in forum Using Fedora
    Replies: 7
    Last Post: 16th March 2011, 09:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •