July 17

Linux: Fedora – Enterprise login user cannot obtain sudo or root

This happened specifically with Fedora 28, but may apply to other versions.

Summary:
Open a shell in initrd, mount /sysroot as read-write and edit /sysroot/etc/group

Steps:
1. Reboot
2. In grub press “e” to edit the menu entry
3. Search for a line that starts either with linux16 or linuxefi and append the string ” rd.break”
4. Press ctrl+x
5. Mount the /sysroot as read-write: mount -oremount,rw /sysroot
6. Open /sysroot/etc/group in a text editor
7. search for the line “wheel:x:10:” and append your user
8. You may run into selinux issues, so either set it to permissive (edit /sysroot/etc/selinux/config) or touch /sysroot/.autorelabel
9. reboot again
10. If in step 8 you set selinux to permissive, restorecon /etc/group and reset selinux back to enforcing and reboot again.


Copyright 2021. All rights reserved.

Posted July 17, 2018 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B