Slashdot Mirror


Sudo vs. Root

lessthan0 writes "In Mac OS X, the root account is disabled by default. The first user account created is added to the admin group and that user can use the sudo command to execute other commands as root. The conventional wisdom is that sudo is the most secure way to run root commands, but a closer look reveals a picture that is not so clear." The article is about OSX but the debate is a little older ;)

6 of 327 comments (clear)

  1. Layered Security by Mattygfunk1 · · Score: 4, Informative
    The conventional wisdom is that sudo is the most secure way to run root commands, but a closer look reveals a picture that is not so clear.

    The article doesn't say that sudo isn't the most secure way to run commands, it just details how to make it even more secure.

  2. This just in: by djh101010 · · Score: 5, Informative

    News flash: Sudo, like many other tools, has a configuration file, which allows you to customize it's behavior. Details will be provided as they become available.

    C'mon, anyone with even a passing involvement with sudo has looked at the sudoers file. You can configure pretty much any group or role based permission you want; if you can describe it as a logical statement, you can do it in sudo. Yes, out of the box, you can sudo to a shell (or to an app which has a shell escape).

  3. Re:Sudo is only useful when there are lots of admi by Joshua+Cowan · · Score: 4, Informative
    most admins get so irritated at having to type sudo before every command that they'll just sudo into a shell and be done with it
    The BOFH patch for Bash works well for this scenario.
    For a single-user system, sudo is pointless.
    It is an effective way to eliminate root logins and encourage least privilege practices.
  4. Re:How To Become Root on OS X by beelsebob · · Score: 4, Informative

    The root account is disabled by having the shadow password set to * - thus you can't enter a valid password for root. If you already are root (as in this case) you don't need to enter a password, and thus it allows you to do the command.

  5. Re:Sudo is only useful when there are lots of admi by Flwyd · · Score: 4, Informative

    I'm the only user on my Linux laptop. My password is dead simple; I'm not worried about security -- the most likely people who might try to do something to my computer are other developers in my company, and they probably have a good reason.

    However, I never run sudo su Why? Being forced to type "sudo" in front of potentially dangerous commands forces me to think a second time and make sure I'm not doing something stupid. If I type rm -r * and get prompted that I don't have access, you bet I'm going to double check to see if I'm in the right directory.

    --
    Ceci n'est pas une signature.
  6. Re:Sudo is a tool not the entire solution by Hieronymus+Howard · · Score: 4, Informative

    4. Allowing non-human users (e.g. www) to execute a strictly limited set of commands as root.

    For example, I have this command in my sudoers file:

    www ALL = NOPASSWD: /sbin/ipfw add 2000 deny ip from [0-9.]* to any in

    This allows apache to use /sbin/ipfw to add the ip addresses of script kiddies to the firewall. Note that only adding addresses to one particular rule (in this case rule 2000) is allowed - any other usage of ipfw will fail.