I’m really astonished at the number of times that new Linux users complain about sudo, and about the absence of a root account in Ubuntu. So let me just go over this once and for all. Then the next time someone mentions this on the ubuntu-users or debian-user list, I can just point them here.
If you’re not familiar with Linux, sudo is a command that allows you to run a single command as the root user; it stands for “superuser do,” or at least it used to. Now I think it just stands for “sudo”. In turn, the root user is the first user created on any UNIX box, and is the all-seeing eye on any UNIX box. Root can change passwords, can look at everyone’s files, can run any program, and can delete any file on the disk. Hence the single command sudo rm -Rf / will delete every single file on the hard disk. (rm is the command to delete [it’s short for “remove”, I believe] a file, and / is the base of the filesystem. The -R argument means “delete files recursively,” and the -f argument means “Answer yes if the system asks me whether I’m sure I want to delete a file.”) Root is a powerful thing.
Now, if you wanted, you could sign in as root using the su command (which, again, used to stand for “superuser” but now just stands for itself) and happily execute lots of commands as root. However, this is dangerous and bad, and no one should do it. You might leave yourself logged in, and someone else could come along and wreak havoc. You might forget you’re logged in as root and execute a command that you think you’re executing as an ordinary user, thereby causing unintended mischief. You might edit a file as root and save it, thereby changing the owner to root and causing still more unintended consequences.
The point is that root is a very dangerous tool, and even the best of us can make mistakes with it. That’s why sudo exists: you run a single command as root, then exit. Sudo has other advantages as well:
No one needs to know the root password. You use sudo with your own password, after the root user enters you in the /etc/sudoers file. If your company has you in the sudoers file, and they fire you, they can just take you out of the sudoers file; they don’t need to tell everyone to use a new root password.
You can specify, in /etc/sudoers, what limitations sudoers have. That is, it allows finer-grained control than just “root v. not-root.”
Ubuntu actually gets rid of the root user: when you install it, you create a regular user, who immediately gets entered into /etc/sudoers. This leaves open a security hole, namely that if you want to sign into single-user mode, you can’t do so with the root password. Hence Ubuntu allows you to sign in with no password. This seems dangerous to me, but you’re only going to use it when you have local access to the machine — i.e., when you’re sitting in front of it. The common wisdom seems to be that anyone with physical access to the machine has basically arbitrary control anyway. This has never seemed an especially convincing argument to me: yes, given a long enough amount of time, someone with physical access to the machine could infiltrate any data on it. But suppose the machine were physically secured with a padlock; that the BIOS were password-protected (or, e.g., protected by the requirement that you plug in a USB key drive with your private key on it before you were allowed to log in); that as much of the disk as possible were encrypted; that you needed a thumbprint of some kind to access the operating system; that the hard drive would wipe itself after a certain number of failed password attempts; and so on and so forth. Yes, it’s still possible that someone with physical access to the box could access your data, but it’s unlikely. And if, for instance, the attacker only had a limited amount of time in front of the box — say, it’s the FBI trying to plant a keylogger on your disk while you’re at work — then these additional hurdles would be a real obstacle.
In any case, I hope this addresses the common objections to sudo. You want to use it. Really. I promise.