I’ve had a couple instances where I went to
sudo su and it would say I’m not in the sudoers.
login as root
usermod -a -G wheel (username)
exitand log back in as your user.
If you can’t login as root:
- Reboot. You’ll be given 5 seconds at the boot menu to select the operating system kernel to boot into.
- At the boot menu, press
eto edit the existing kernel (Core).
- In the boot grub menu select option to edit. Select Option to
- Go to the line of
Linux 16and change
- Now press Control+x to start on single user mode.
- Now access the system with this command -
- Reset the password -
- Update selinux information -
- Exit chroot -
- Reboot your system -
- Now do steps above to give another user sudo rights as it’s best practice to not use root directly for anything except for tasks like these.