Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
As you can see I want userx to be able to add users, change their passwords and remove users, but I do not want userx to change the root password which he does not know.
However this does not prevent userx from doing something like:
Code:
sudo passwd -l root
or
Code:
sudo userdel root
So how would I configure userx so that he can administer users on the server while still preventing him from actually becoming root or breaking something?
What is best practice?
Distribution: Fedora, Mandriva, PCLOS, SUSE - anything a can get my hands on
Posts: 140
Original Poster
Rep:
No I get that.
My question is, is there a easier way to do this than adding every single possible option that can be used with userdel, passwd related to root in sudoers.
As you can see I want userx to be able to add users, change their passwords and remove users, but I do not want userx to change the root password which he does not know.
You can see I am not allowing "/usr/bin/passwd root" to be executed like I mentioned.
Therefore I can also add
Code:
!/usr/bin/passwd me
and
Code:
!/usr/bin/passwd -l me
and
Code:
!/usr/sbin/userdel root
and
Code:
!/usr/sbin/userdel -r root
until I have included
Quote:
Originally Posted by FNC
every single possible option that can be used with userdel, passwd related to root in sudoers.
This might take a long time and some effort, but probably not as long as trying to explain it on this forum...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.