so my school had me try to disable root login by editing /etc/passwd file, root:x:0:0:root:/root:/sbin/nologin

the plan is to have me use sudo commands to then revert this change. but since doing this change, sudo commands when used asks for password of the non sudo user im logged into and then proceed to give me a error saying the username is not in sudoers file. how do i fix this?


1 Answer 1


i managed to fix this issue, for anyone experiencing the same, simply press e on grub2 menu and type rd.break enforcing=0 to avoid any SELinux errors when booting. then mount the root file system in read/write mode. mount -o rw,remount /

then use nano /etc/passwd to make your changes then ctrl x to exit, save your changes then type exit twice to logout and boot up normally

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .