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.
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.
- Understanding the /etc/sudoers file
- Setting a text editor for visudo
- How to give passwordless root priviledges to a normal user
- How to give root access to a group for a few commands only
- How to give root access to a normal user for a few commands only
- Why to use sudo?
- sudo vs gksudo : What are sudo and gksudo and when to use them?
The article I have linked here are generical Linux articles, so the information is valid even on Mageia 3.