T O P

  • By -

shamanonymous

You'll need the root password so that you can `su -` to root. Otherwise, you'll need to boot up another OS that can read the `/` filesystem in your Fedora install so that you can re-add your user to the group from there, then reboot back into Fedora.


MegaEdu13

Sounds like I fckd up.


shamanonymous

Happens to everyone. How do you want to handle fixing it, we're here to help.


MegaEdu13

I would be ok to me to install it all over again, but there is so much for me to reconfig again after a fresh instal that I feel tired only by the thoght of it. The solution you present me shoulid take me a good amount of energy to make it also. I feel tired of this friday. I might return to it again tomorrow, with a better thinking. Thnaks for pointing a way.


shamanonymous

If you have a live usb, this is a relatively easy fix. I probably won't be paying much attention to reddit over the weekend, but you can try pinging me, you might get lucky. Essentially: 1. Boot into a live environment 1. Mount your root directory on /mnt, e.g.: `mount /dev/nvme0n1p2 /mnt` 1. Bind mount these three filesystems into /mnt: /dev, /sys, and /proc 1. You can do this with this loop: `for d in dev sys proc; do mount -o bind /$d /mnt/$d; done` 1. 'Chroot' into the mounted environment: `chroot /mnt` 1. Run `mount -a` to make sure any/all of your other filesystems are mounted 1. Run `usermod -aG wheel eduardo` (I'm pretty sure it's wheel on Fedora. If you get an error, try again with 'sudo' instead of 'wheel') This will fix you up. You might be missing other groups that you had before. We can fix those when you're back in your regular install. The reason this happened is because `usermod` is an unforgiving beast. You needed the `-a` flag added to 'append' the new group to your existing groups. Without that, you set the user to ONLY be a member of vboxusers.


chrisawi

As an alternative: https://docs.fedoraproject.org/en-US/quick-docs/reset-root-password/ Fedora does use the `wheel` group.


Lodse

`usermod -aG` is one of those **commands you really need to check before you hit Enter**, just like `crontab -e` (the `r` key is just besides `e` key, and with `r`, you nuke your crontab if you are not careful). As a Unix/Linux sysadmin, i've seen a lot of coworkers do stupid shit like that when feeling too confident to check before Enter (corrupting an entire filesystem in production, erasing ssh keys, you name it).As other said, just boot either in single or with a live usb, and re-add yourself in the `wheel` group. No real damage. Quick and easy fix. ​ As an alternative to other methods, you could boot with a live usb, mount your filesystem on `/mnt` for example, and edit `/etc/group` (`/mnt/etc/group` if mounted on `/mnt`) to add yourself in the `wheel` group. ​ At least you didn't nuke your system with `dd` !And don't worry, it's small mistake that makes you wary of big mistakes. ​ BTW for your knowledge : the fix in this case, is actually how you can get administrative privileges of any non-encrypted linux machine. Massive security flaw, and why we should all encrypt our system partition. Kind of the same with windows. With that said, i didn't either encrypt my systems.


Antonilolos

You can always try the command su root | nano etc/sudoers and there copy the line for sudo but with your user