Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

in a linux system with

su - 

any user (with root password) can get root privileges. how I can restrict to some users ?

// similar to AllowUsers in sshd_config

share|improve this question
The best way to control it is not giving every user the root password. When you give them the root password, you have given up control over what they do. Anything that you do to stop them, they can undo. – EBGreen Apr 4 '12 at 15:12
Yup, don't give them root password. If you want them to get restricted administrative privileges, use sudo with explicitly allowed binaries. This is still tricky, but at least you have some possibility to actually log what they are using their root privileges for (with maaany caveats if one is not careful). The solution to your specific question is: change the root password and only tell the ones who should have root access the new password. – Daniel Andersson Apr 4 '12 at 15:18
up vote 7 down vote accepted

You should not give the root password to users who do not need full root access.

Keep the root password secret and use sudo to give restricted users access to just what they need (see man sudoers for some examples)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .