Ubuntu 10.04 sudoers file complications
Posted by: chiky in chirag, linux, tags: chiky, linux, root user, sudo, sudoers, ubuntuI don’t know why Ubuntu is so careless with the admin stuff. First of all, you can’t login as root by default. You have to set up root password by doing ‘passwd root’ (this is what I love about OpenSUSE, you have a root user and a normal user, you can login to the root user GUI also and do stuff). And by any chance, if you forget to do that and you’re locked out of the system or your default user’s admin previliges have been taken away (exactly what happened with me), you’re kinda doomed.
Well, not exactly. Ubuntu is kinda carefully-careless with this stuff. It punishes you when you are being careless, but provides you with some open doors to pass-through. So, as they say, you should not edit a /etc/sudoers file by hand and save it and do it with the ‘visudo’ command so that it checks the syntax, creates a backup file and then replaces it. Even if you have done all these steps by hand, and you just replace the file yourself, and make a small mistake, your default user will get deprived of the sudo permissions and you’ll be left without anything in the state of misery.
What do you do now? Search up the Internet, people will tell you to boot the failsafe option, open the recovery mode and change the sudoers file. As what happened with me, I could not boot into the failsafe kernel as GRUB menu didn’t show up. Then I realised, theres more to Linux than the “terminal”.
I just looked at the GUI, opened the “Users & Groups” application and made myself the “Administrator” and entered my password (which worked). It allowed me to do this. Probably because this application doesn’t use sudo as back-end. On the other hand, if you try to open “Software Management”, you won’t be able to. The strange thing is that still this thing did not work. Then I opened the advanced preferences of my user and saw there is another group “sudo” in the group list. I checked that too. And wholaa, everything started working.
Analysis: When you first install Ubuntu, the default user is given the sudo permissions. But if you happen to edit the sudoers file and make a mistake (such as removing the % sign in front of ‘admin’ ), sudo automatically expects you to be a part of the “sudo” group (which is the last group inside the sudoers file ) which you are not a part of by default, so you get locked out.
The thing to do is to, add yourself (the default user) specifically to the sudoers file and not reply on the groups, so whatever may happen, the default user will get admin privileges.

Wall RSS Feed