the psycho cat on an HP Mini with Ubuntu
* Off-site link
You may also want to consider donating directly to the Ubuntu project.
I happen to much prefer Ubuntu and Mac OS X's sudo model to the root/user one that's typical of most Linux distributions. You can read all about why Ubuntu uses sudo and all the pros and cons of that model at help.ubuntu.com/community/RootSudo.
The one thing I don't like about sudo is how fragile it is. If you don't know what you're doing (especially at the command-line), sometimes sudo can get broken. It doesn't happen very often, but it does happen. That's what this page is for.
If your sudo is "broken," meaning that you can't use the sudo command to temporarily gain administrative privileges, there are two files you should be aware of:
/etc/sudoers and /etc/group
The /etc/sudoers file should look the same for every Ubuntu user who hasn't fiddled with it:
# This file MUST be edited with the 'visudo' command as root.
# See the man page for details on how to write a sudoers file.
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
# Members of the admin group may gain root privileges
It basically says anyone who is root can do anything, and anyone in the administrative group (people who can sudo) can do anything (with a password).
Now, the /etc/group file will look different for every Ubuntu installation. It specifies which groups each user belongs to. An example of how it might look is here:
For troubleshooting purposes, the most important line in the /etc/group file is the one in bold, which specifies who is in the admin group, and hence who has sudo privileges. Substitute your actual username for firstuser, of course.
Now, this begs the question, "How can I edit the /etc/group file if I don't have sudo permissions?"
The answer is something called recovery mode.
After you boot into recovery mode, you should be logged in as root. Or, if you set a root password in your installation, you'll be prompted for your root password. Either way--password or not--you'll end up logged in as root.
cp /etc/group /etc/group.old
cp /etc/sudoers /etc/sudoers.old
Then, to edit the files, use these commands:
This command edits the /etc/sudoers file.
nano /etc/groupThis command edits the /etc/group file.
If you don't want to bother editing the /etc/group file, you can also issue this command:
adduser username admin
That one command will add user username to the admin group so you can sudo
If you are trying to fix the error where it says sudo is mode _____, should be 0440, then you'll want to type
chmod 0440 /etc/sudoers
When you're done, reboot, and you should be able to sudo again.
I will not give help to people posting in the above places. If you require technical support, start a support thread on the Ubuntu Forums. That is the appropriate place to ask for help.