Archive for the ‘Root’ Category

Unix: Removing outside Root access from Ubuntu

Saturday, March 28th, 2009

Every Unix box has a root account, or an account that has absolute control over the machine, its files and controls.

From all accounts, admins should use this account sparingly, only for cases where cross-system control is needed. You can make big mistakes (i.e. wipe out the system with a badly-worded command) from root. If you have work to do that can be done from a user account, use that instead.

Ubuntu has taken this precaution to the next level. When you install Ubuntu, it disables the root account. If you want to do root commands, you issue them from your account through the “sudo” command. basically sudo allows you to issue commands from another user’s account (assuming you have the password).

The idea behind this is that not only will it limit the mistakes you may make, but also reduce the attack footprint of your server. A cracker, trying to get in via SSH, doesn’t even get the option to guess the password to the root account to gain entry, because root can’t log in from SSH at all.

Now, like many old Linux codgers, as soon as I set up Ubuntu, I enabled the root account, mainly because filling in a password every time I wanted to do something in root was a pain. But I just learned that sudo actually has an option (sudo -i) that will allow you to work within a shell of a user account entirely–this means you evoke sudo once and then every thing you do from the command line is done from the account you’ve sudo’d in from, such as root. which is pretty neat, and eliminates the need to be able to access root from the outside (i.e. via SSH).

But if you already enabled root on your Ubuntu, how do you un-enable it? Simple, from the root account, use the psswd command to “lock” the account, i.e. make it inaccessible from outside users. “passwd -l root”

–Joab Jackson