the psycho cat on an HP Mini with Ubuntu
Just Beginning
Which Ubuntu to pick?
Ubuntu inside Windows
Install Software Next Steps Beyond the Basics Playing Around Troubleshooting * Off-site link
Cheap Plugs You may also want to consider donating directly to the Ubuntu project.
|
Fix Broken Sudo
How does sudo work?
You can read more on the community documentation about Ubuntu's implementation of sudo.
If you have a single-boot (Ubuntu is the only operating system on your computer), to get the boot menu to show, you have to hold down the Shift key during bootup. If you have a dual-boot (Ubuntu is installed next to Windows, another Linux operating system, or Mac OS X; and you choose at boot time which operating system to boot into), the boot menu should appear without the need to hold down the Shift key.
The root account is the ultimate administrator and can do anything to the Ubuntu installation (including erase it), so please be careful with what commands you enter in the root terminal. In recent versions of Ubuntu, the filesystem is mounted as read-only, so you need to enter the follow command to get it to remount as read-write, which will allow you to make changes: mount -o rw,remount /
adduser username sudo where username is your actual username.
Case 1B (Ubuntu 11.10, 10.04): If you'd removed your last admin user from the admin group, then type adduser username admin where username is your actual username.
Special thanks to philinux for pointing out the new change as of 12.04. Case 2: If you had previously edited the /etc/sudoers file and screwed it up, then type sudo cp /etc/sudoers /etc/sudoers.backup (the proper command is actually sudo visudo, which checks syntax before you save the /etc/sudoers file, but in some older versions of Ubuntu, that command uses the vi editor, which can be confusing to new users, as opposed to nano, which is more straightforward) sudo nano /etc/sudoers and make it sure it looks like this: #
When you're done making changes, press Control-X, Y, Enter.
# This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias specification # User alias specification # Cmnd alias specification
# User privilege specification
# Members of the admin group may gain root privileges
# Allow members of group sudo to execute any command # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d
Case 3: 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 with whatever commands you needed to enter, type exit This will bring you back to the recovery menu.
Last updated 11/12/12 10:32
|
If you have suggestions or corrections for these tutorials, please post in this Ubuntu Forums thread or leave a comment on my blog. 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. |