Understanding and Fixing sudo

Most Ubuntu users never have a problem here, but sometimes, people who like to experiment break things, especially while learning. This section exists to help you first understand more completely how sudo works and also how to restore sudo access to a specific user when, for some reason, it has ceased to function for that user.

Note

You will usually know a problem has occurred because an error message like this will appear when a user tries to issue a command using sudo:

Click here to view code image

matthew@seymour:~$ sudo shutdown -h now[sudo] password for matthew:matthew is not in the sudoers file. This incident will be reported.

Sometimes, you might not even receive an error message, but the command issued simply ...

Get Ubuntu Unleashed 2015 Edition: Covering 14.10 and 15.04, Tenth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.