O'Reilly logo

Linux Utilities Cookbook by James Kent Lewis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using sudo to secure a system

There may be times, especially if you are a system administrator, when you would like to give a user more access to the computer, but not actually root authority. This can be done by modifying the /etc/sudoers file and having your users invoke the sudo command.

Getting ready...

The following steps should not harm your system. We will perform these with a user account made above. You will need to be the root user for this section.

How to do it...

Here we will work with the /etc/sudoers file:

  1. Make a backup copy of your /etc/sudoers file:
    cp /etc/sudoers /tmp/sudoers.orig
    
  2. You don’t edit this file directly, the visudo command is used. This is poorly named as any text editor can be used if you export the EDITOR variable accordingly. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required