How to restore sudoers access, or reset root password?


I have lost access in sudoers file and forgotten root pwd. How to recover?

I’m on Fedora 36 and have downloaded Fedora 38. However, install/upgrade fails to proceed when it asks for an Administrator password. sudo in Terminal window also tells me my userid is not in the sudoers file. Without a known root password, how can I proceed?

Note: The last thing of interest I did was to begin planning for hercules emulator several weeks ago. Userid hercules was created and also hercgrp group & that’s as far as I got. Since hercules on linux requires building from scratch, I have some work to do of the sort I’ve never done before and I’ve yet to dive into that. Of course, I won’t be doing much of anything until I can restore sudo and/or root access.


You can follow How to Reset the root Password :: Fedora Docs to reset your root’s password.

You can also use the groups command to see what groups your user belongs to. The admin user should belong to the wheel group to get sudo access by default.

Thank you for the tips. Fedora Doc for root pwd reset worked seamlessly, as did the gpasswd cmd for rejoining the wheel group.