[SOLVED] How to use sudo to run ALL commands requiring root

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] How to use sudo to run ALL commands requiring root

Postby simonhoare » Dec 1st, '12, 19:01

In spite of adding myself to the group "wheel" and to the sudoers file, as well as uncommenting the wheel line in the sudoers file, I find I am still asked for the actual root password when doing certain tasks e.g. opening the Mageia Control Center.

It would be preferable to avoid this and use sudo for everything requiring root privileges.
Last edited by simonhoare on Dec 1st, '12, 20:47, edited 1 time in total.
User avatar
simonhoare
 
Posts: 32
Joined: Dec 1st, '12, 18:56

Re: How to use sudo to run ALL commands requiring root

Postby digigold » Dec 1st, '12, 19:28

You probably have this line:
Code: Select all
 %wheel        ALL=(ALL)       ALL


You should have this line:
Code: Select all
 %wheel        ALL=(ALL)       NOPASSWD: ALL
"A mind that is stretched by a new experience can never go back to its old dimensions."
~Oliver Wendell Holmes, Jr.
User avatar
digigold
 
Posts: 150
Joined: May 9th, '12, 14:50
Location: Northern U.S.

Re: How to use sudo to run ALL commands requiring root

Postby simonhoare » Dec 1st, '12, 19:34

Ok thanks but just to be clear, I still want to be asked for a password. Just the user password and not the one for root.
User avatar
simonhoare
 
Posts: 32
Joined: Dec 1st, '12, 18:56

Re: How to use sudo to run ALL commands requiring root

Postby digigold » Dec 1st, '12, 19:42

simonhoare wrote:Ok thanks but just to be clear, I still want to be asked for a password. Just the user password and not the one for root.

Then remove the user from the wheel group and under visudo comment the two aforementioned wheel lines out goto the line below:
Code: Select all
root    ALL=(ALL)       ALL

and if your UN=simon add:
Code: Select all
simon    ALL=(ALL)       ALL

(Don't remove the root line BTW!)
This should require simon's PW when sudo is run from that account.
"A mind that is stretched by a new experience can never go back to its old dimensions."
~Oliver Wendell Holmes, Jr.
User avatar
digigold
 
Posts: 150
Joined: May 9th, '12, 14:50
Location: Northern U.S.

Re: How to use sudo to run ALL commands requiring root

Postby doktor5000 » Dec 1st, '12, 19:42

If you use sudo or the Mageia tools? For the latter, in MCC go to Security -> Configure authentication for Mageia tools
or call it directly via draksec. The authentication of drakxtools has nothing to do with sudo configuration.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18059
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How to use sudo to run ALL commands requiring root

Postby simonhoare » Dec 1st, '12, 19:51

Ah really? Suspected that a little bit, having set up sudo on other distros.

Sudo works as it should. It was really more to avoid using root password at all for daily work. I've seen the authentification options in MCC now and maybe I'll leave those alone until I've worked out the consequences.
User avatar
simonhoare
 
Posts: 32
Joined: Dec 1st, '12, 18:56

Re: How to use sudo to run ALL commands requiring root

Postby doktor5000 » Dec 1st, '12, 20:30

Care to mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18059
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Basic support

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest