How to Install and Configure Sudo on Mageia 3

Hello Mageia Users. In this article I will show you how to install and configure sudo, on Mageia 3 Linux.

As you know, sudo is used for getting root priviledges to a normal user when invoked to execute some commands, asking for his current password (not the root’s password).

To check if sudo is installed, use one of this two commands, as root:

$ su root
# rpm -qa | grep sudo


# urmpq sudo

Next, if you do not have sudo installed, install it with urmpi:

# urpmi sudo

Now that you have sudo installed, you have to give your user or group sudo priviledges.

To do this, you have to edit the /etc/sudoers file, as root. A good command for editing the /etc/sudoers file is visudo. visudo opens the /etc/sudoers file in your default text editor, but tells you if you mess something up in this file.

# visudo

To give root access to user mike, add this line in /etc/sudoers file (inside the file opened by visudo):

mike ALL=(ALL) ALL

To give root access to the users belonging to the group geeks, paste this in the same file (please notice the % sign in front of the group’s name):

%geeks ALL=(ALL) ALL

The user mike and the users from the group geeks can use sudo only after they log off and log back on.

This is it. Enjoy.

Related reading:

The article I have linked here are generical Linux articles, so the information is valid even on Mageia 3.

Tagged with: , , , , , , ,
Posted in The Linux and Unix Articles!
One comment on “How to Install and Configure Sudo on Mageia 3
  1. liberforce says:

    Hi, there’s a litle mistake there. urpmq sudo is not the same as rpm -qa | grep sudo. rpm will search in the local rpm database to see if sudo is installed. urpmq will just check that a package named sudo is available in the configured repositories, but won’t tell you if it’s installed or not.

    You should also say “use one of *these* two commands” instead of “use one of *this* two commands”.

Leave a Reply

Your email address will not be published. Required fields are marked *




Subscribe to get the latest Linux news and how to guides directly on your e-mail!