Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
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 does nothing. Either way, you can fix the problem by using
the following knowledge and procedure.

In order for a user to use sudo, the user account must belong to the sudo
group and must also be listed in the /etc/sudoers file. If both conditions
are met, the user will be permitted to temporarily use root powers for specific
commands that are issued at the command line by that user account by
prefacing the command with the word sudo.


A problem can occur for a specific user with sudo in several situations:


    When    the user    is  taken   out of  the sudo    group   but should  not have    been
When the permissions for the /etc/sudoers file have been changed
to anything other than 440
When the /etc/sudoers file has been changed in a way that does not
allow members of the sudo group to use root powers

These problems generally result from users doing something they should not
have done, such as changing the permissions on all files rather than taking the
time to figure out a specific file that is causing problems due to permissions
issues. Take heed: It is better to spend a bit more time learning than it is to
take a shortcut that causes bigger problems.


Fixing any of these problems requires the use of root powers. This is an
obvious problem because if sudo is not working, the account does not have
access to root. To fix it, you must gain root access. You can do this by booting
into recovery mode, using the following steps:



  1. Hold down the Shift key while the computer is booting.

  2. When the GRUB menu page appears, use the arrow keys on your
    keyboard to scroll to the entry that ends with (recovery mode) and
    press Enter to select it.

  3. When the boot process finishes, and have several options, select the
    menu entry for root: Drop to Root Shell Prompt. You are now at the
    command line, with full root access to the computer.

  4. Because Ubuntu mounts file systems as read-only by default in recovery
    mode, you need to remount the root file system, /, as read/write so that
    you can fix the problem. Enter the following:
    Click here to view code image

Free download pdf