Saturday, 8 February 2014

Changing How sudo Works in openSUSE

The default way a user in openSUSE 13.1 executes sudo to run a restricted file is that they need the root user password rather, as many other Linux distributions, than their own.  By design, this is a better way to manage root access - but  if you want sudo to require your password rather than root's then keep reading.

Personally, I like a mixture of both on my personal machines.  I sometimes su, using root's password and at other times I use sudo with my own password.

To do this, the first thing I do when I install openSUSE is to give root a different password than my own.  Do this by deselecting the "Use this password for system administrator".


If you already have openSUSE installed, then simply su to root and then passwd to set a new password.

Now the fun stuff.

As the root user execute visudo, you need to comment out the last two lines of the below:



In the same file, you need to enable the wheel group by uncommenting the last row from below:


Make sure you save when you quit visudo.

One last step, as root still, add the privileged user to the wheel group ala:
    useradd -G wheel jeff
All done. You need log out and back in as the user, sudo will now act as described above.

No comments:

Post a Comment