9

By default, Ubuntu does not create a root account that the user can login to. Instead users use sudo when they need to perform actions that require administrative access.

Obviously, the people at Ubuntu feel like this is a good idea, and everything I've read on the Ubuntu site gives plenty of reasons why they think it's a good idea (see RootSudo @ the Ubuntu Wiki, for example).

However, many other mainstream distributions, such as Debian, Gentoo, etc. don't set things up this way by default, and I'm trying to figure out why. If Ubuntu's default sudo-root setup is such a good idea, why aren't all of the other mainstream distros doing it too? This leads me to believe that there might be strong reasons for NOT setting it up this way; but I'm having trouble finding anything that gives any details on this. All I'm finding is articles/posts that talk about how great it is ...

So my question is: Are there any major problems with Ubuntu's sudo setup (insecurity, functional limitations, etc.) that prevent other distributions from using this setup, and if so what are they? Of course, it might simply be a great idea that other distros have just been slow to pick up on, or resistant to because it's different from how things have worked for the past 30 years. If that's the case, I'd like to know that to.

3
  • 3
    Have you seen unix.stackexchange.com/questions/8581/… ?
    – mattdm
    Mar 20, 2011 at 20:19
  • No I hadn't seen that. Thanks for pointing it out. It pretty much answers most of my questions about the pros/cons of using sudo ... although I'd still be interested in understanding the motives of other distros for not doing things the Ubuntu way.
    – J. Taylor
    Mar 20, 2011 at 21:30
  • 1
    Well, FWIW, I've been pushing for Fedora to do this since, well, since before Ubuntu existed, and I believe it'll finally be the default in F16 if not F15.
    – mattdm
    Mar 21, 2011 at 13:29

6 Answers 6

4

The only non subjective disadvantage I know if is that when the root user does not have a password set it allows access to single user mode without a password.

A truly secure machine will be in a locked case, have booting from removable media disabled, a BIOS password set to prevent changes, a bootloader password set to prevent the kernel boot cmdline from being changed (so no adding init=/bin/sh), and a password would be required to access single user mode.

3
  • 1
    If you can't add init=/bin/sh, you can't add single either, so in either case the bootloader password provides your protection there.
    – mattdm
    Mar 21, 2011 at 13:34
  • 2
    But if an error occurs during boot (such as while fsck'ing a partition) it will drop you into single user mode without prompting for a password. Mar 21, 2011 at 18:19
  • 1
    Depends on your init system. In RHEL5, that runs sulogin; this could be configured differently.
    – mattdm
    Mar 21, 2011 at 18:24
4

When you use vi instead of visudo to edit /etc/sudoers on a remote system and mess up the syntax, you can no longer sudo, or use su as there's no root password set.

I have done this. I have learnt from this. It burnt. :-)

3

Basically, sudo gives you administrative privileges. If you have no root account, and your user have ALL=(ALL) ALL in /etc/sudoers, then your user is a superuser. It's not recommended since you can execute commands with administrative privileges using sudo and YOUR user password.

Administrator MUST configure sudo to admit some commands for the users, but some administrative tasks will be root only, so root is the real superuser.

The real problem is that privileges are a privilege. The MOST secure system will have just 1 superuser, and it's root.

See this

1
  • In a nutshell: Administrative privileges should be used for administrative tasks, not for desktop, every day usage.
    – D4RIO
    Mar 20, 2011 at 21:08
3

In those other distros you mention, it is advisable to create (or rather uncomment) a line in /etc/sudoers, that gives the group wheel unlimited access, and then add yourself to that group.

This is not only exclusive to Linux, but also standard on *BSD, and I believe even on Mac OS X (not sure about the last one, as I don't use Macs regularily).

7
  • 1
    in case more people need root access to a machine, this is by all means the advisable way, instead of giving more people the root password.
    – polemon
    Mar 20, 2011 at 21:14
  • Yes -- this is what I used to do when I was running Gentoo. But if the best way to give regular users full access to root is to place them in wheel + sudoers, then I don't understand why they wouldn't just want to set up sudo-root by default, and then let them create a root account manually if they actually need a root login.
    – J. Taylor
    Mar 20, 2011 at 21:32
  • sudo is not a new invetion, it's been there for years. Maybe Ubuntu has something even different in mind, or simply tries to copy Windows behaviour.
    – polemon
    Mar 20, 2011 at 21:40
  • I understand that sudo is not a new invention, but the way that Ubuntu uses it (i.e. to remove the root account altogether) is certainly unusual, when compared to other distros.
    – J. Taylor
    Mar 20, 2011 at 21:43
  • 2
    Giving unrestricted sudo access is not in fact more secure than giving out the root password, seeing as how anyone with that level of access can just sudo passwd and lock everyone else out. As always, the weak link in security is between chair and keyboard.
    – Shadur
    Mar 20, 2011 at 22:00
2

I suspect it's largely a matter of inertia. Once upon a time, the sudo command didn't exist, so the root account had to be configured with a password. According to "A Brief History of Sudo", referenced from this Wikipedia article, sudo was first implemented around 1980, but it probably didn't become widespread until the 1990s.

There may still be a tendency to view sudo as an add-on convenience, rather than as something that should be at the core of how systems are managed.

1

As mattdm pointed out, this question (for the most part) has already been answered here: Which is the safest way to get root privileges: sudo, su or login?

2
  • (I say "for the most part", because I'm still interested in understanding why other distros don't choose to switch to using sudo)
    – J. Taylor
    Mar 20, 2011 at 21:29
  • 2
    Well I was looking at it from the other side. I didn't understand why ubuntu choose sudo over other methods. My concerns are stated in the question but to summarise: If an attacker can run code as my normal user I can't trust the system from the moment I logged on. I can't be sure if I started the real sudo or a password stealing version.
    – stribika
    Mar 20, 2011 at 23:31

You must log in to answer this question.

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