From Mageia wiki
Jump to: navigation, search

This page was a duplicate of an existing page, but I have merged them. This page is only of use to new users, an experienced sysadmin would not need it, so I have retained the newbie-friendly tone of the deleted page. I have also made it a little less generic and simplified it. For instance, in Mageia, the path for admin commands is already defined in $path, so it's not necessary to use them. Yes, I know it's best practice to use the full path (in case someone has messed around and changed the $path to somewhere malicious), but this is extremely unlikely and if they have done that they have root and you're screw*d anyway. simonnzg 22:37, 29 March 2013 (UTC)

codegazer writes:

I wrote this page from scratch as I had not found anything on sudo. Regarding caution in not trusting $PATH, it's not extremely unlikely. I have used this in professional ethical hacking assignments. Others are likely to use it also. It is a good idea to develop security awareness and care especially when doing sysadmin tasks. codegazer 2014_09_12 23:52 (GMT-1)

Testing sudo

  • I think that your page is very interesting and that is the reason why I tried to improve it by modyfiying section 4 into a testing sequence. Asking people to logout for testing is not good at all. The cost of a logout on a server is very high. Thus if you find my explanations to complicate, please improve them but don't delete them. As a wikipedian, I will not give up and I am used to improve texts and never deleting them. You already deleted it in the past but I didn't checked and was very very surprised to discover your deletion. Thus, please, improve it or discuss it here.--nbrouard 15:32, 5 December 2014 (UTC)

codegazer writes:

Nbrouard, Thank you for commenting that you find the page interesting. I hope it is helpful to Mageia users and I welcome suggestions to improve it or to correct any errors.

I have discussed your modification of the "Configuring sudo" wiki page with other contributors to Mageia. In particular, I discussed that what you have proposed to add and it is considered to contain examples of using the "su" command insecurely. This is simply not necessary and not consistent with the rest of the wiki page.

I have undone your addition because it is simply not needed. It is also misleading because it suggests that sudo cannot be used unless the user logs out and logs in again. The fact is a logout/login is only needed if the user happens to be logged in at exactly the same time as being added to the wheel group.

In addition, we need to keep these wiki pages simple, clear, and accurate and avoid adding unnecessary complexity.

This is the "configuring sudo" page so let's focus on sudo and leave out "su" if we don't really need it. --codegazer 2014_12_24 17:23 GMT

After adding a user to wheel group, that user need to log in for sudo to detect it. In practice, if you added wheel to yourself, you need to log out/in, (or reboot), then sudo will allow you.

Update on 2022_05_10 - comments on https://wiki.mageia.org/en/User:Morgano proposed update to Configuring sudo

Hello Morgan,

Thank you for your interest and taking time to propose to update the Mageia wiki page Configuring sudo (which I contributed).

There are some issues with your proposed changes ( your text in blue, alternative suggested text in green):

# date proposed change comment
1 2022_05_10 List of benefits of sudo. List not changed in any way. Your proposed change has added nothing to the list.

Basically, you have formatted the list in an alternative way. It is a redundant change. Simply unnecessary.

2 2022_05_10 added "simple howto" section This makes the wiki page more complex than it needs to be. You now introduce the idea of "simple howto" and "detailed howto".
This adds no benefit for readers. Instead it may cause indecision: which one does the reader need - the simple or detailed howto? The proposed "simple howto" section is basically a re-iteration of what was already described in the Configuring sudo wiki. Redundant.
3 2022_05_10 "Add any users to have this privilege to the "wheel" group. See step 3 below for how." This just re-enforces the redundancy of the proposed "simple howto" section: especially with the cross reference to "See step 3 below for how."
4 2033_05_10 "Immediately after having added to wheel group, the Mageia Drak tools will ask for user password instead of root password. - If this is sufficient for your need, you do not need sudo." The sentence: "Immediately after having added to wheel group, the Mageia Drak tools will ask for user password instead of root password.": two points:
  1. The (excellent) Mageia Drak tools will not only ask the user for what is needed, they will state precisely what is required. It will be very clear to the user when they do it. However, this wiki page is about Configuring sudo and going into detail about the (excellent) Drak tools which are not using sudo is out of scope.
  2. "Immediately after having added a user to the wheel group" reads clearer than "Immediately after having added to wheel group"

Regarding: "If this is sufficient for your need, you do not need sudo." what is this actually telling the user? Isn't this stating the obvious? I think this is completely redundant and adds no useful information for the reader.

5 2022_05_10 "After adding a user to wheel group, that user need to log in for sudo to detect it. In practice, if you added wheel to yourself, you need to log out/in, (or reboot), then sudo will allow you." points:
  1. This is redundant and is already explained in the Configuring sudo wiki page. Why duplicate what is already there? How does that help?
  2. s/"a user to wheel group"/"a user to the wheel group"/
  3. s/"that user need to log in for sudo to detect it/" then that user needs to logout and login to acquire membership of the wheel group in the shell"/
6 2022_05_10 "sudo is normally installed per default.
So simply try to use it - try in a terminal /bin/sudo echo hurray!,
and if command not found, you install it in same way as any other program from Mageia."
There are some problems with this:
  1. "/bin/sudo echo hurray!" is not testing if the sudo rpm package is installed.
    This is testing if there is a sudo command in a directory on ${PATH}.
    This is a potential security problem because there could be any number of reasons (some not good) why sudo might be on ${PATH}.
    Suggesting that running a command is the same as checking if it is installed is not the same thing. It is misleading.
  2. sudo has not always been installed by default in Mageia. So why suggest it is there by default and then offer a "test" for it?
7 2022_05_10 replaced section header
"Step 1: Ensure that you have sudo installed (and if not install it)" by "detailed howto"
Does not add any benefit to the reader. Just makes it confusing: which one does the reader need - the simple or detailed howto?

Answer to comments 2022-05-10

morgano (talk) 07:47, 11 May 2022 (UTC)

  • Often we propose to users to use sudo. It should then be easy for normal users to get sudo working. The current page is is good for a deeper learning, but its complexity is repelling for normal users. Like checking sudo - even if checking package is installed is not perfect. We have to choose a suitable level.
  • Yes adding a short chapter makes total size even bigger... So even better would to make this page short and simple for normal users, and link to a in-depth page from existing content here, and even un-commenting some nice comment that is now hidden. - I see you have a lot of knowledge and energy, so please do if you like :)
  • The formatting I use is what is recommended on the wiki, sorry if I stepped on your toe.

Bottom line: Our users need a page that quickly helps them to get sudo working. Whoever writes that, and how, is not important. This is not a private wiki.

/Morgan


Response to Morgan's comments

Hello Morgan,

Tack så mycket. Thank you again for both your suggested updates and for your feedback here. All comments and feedback are welcome and appreciated.

I think that there can always be improvement and listening to different perspectives is a good way to find out how to make improvements.

Your point about wanting simplicity for "normal users" is a fair one and it is something I strive to do when contributing to the Mageria wiki.

I also believe that people who are reading through the Mageia wiki are very intelligent and able to learn and adapt.

I have "taken on board" your point about simplicity for "normal users" and I aim to do something about it.

There is another wiki page I contributed Making_a_bootable_Mageia_network_install_USB_drive where I addressed this issue by having a "TL;DR" section to cover the minimum, simplest fastest method especially for people who "have no time" and are in a hurry.


Of course, sudo is a bit more tricky because things need to be done with security in mind. I am aware that some other Linux distros include sudo by default but unfortunately the ones I have seen are configured so that the user does not need even to enter a password to sudo. People may debate this, but it really is not a safe or smart thing to do (I am writing this as a computer security professional).


/Codegazer (aka Paul)

Understanding - also see bug

morgano (talk) 20:47, 11 May 2022 (UTC)

Great then :)

Mageia is a nice distro in that it can be used easily both for simple desktop use, and for more serious tasks.

Therefore sometimes we need to both have instructions for easy use and read for inexperienced users (get sudo to work to be able to follow instructions ore use functions that use sudo) - and also have involved explanations like the one you have here for people who wants to do it seriously. (could not find better word now) (Yes Swedish is my mother tongue.)

BTW, also see mga#17720 - Add option to drakxtools (includes installer) to give a user sudo access


Clarification: there is an option at install time when adding a user to add them to specific groups

Hello Morgan,

I don't know if you noticed it but when installing a shiny new Mageia system when you get to the bit about adding user logins there is an option under the "Advanced" tab to add the new user to groups. This is how I put an account on a new install into the wheel group. It saves a lot of time becauase by doing this it means the newly added user can use sudo immediately on their first login.

#If_It_Aint_Broke_Dont_Fix_It  ;-)

It is broken in that it is missing user guidance

morgano (talk) 07:45, 13 May 2022 (UTC)

(tip: four tilde on a line by itself evaluates to the above line when submitted)

New user don't know that wheel is used to enable sudo. Reply in bug.