Tuesday, August 5, 2008

Using Root in Ubuntu

Ubuntu is a great operating system for new comers to Linux. However, many advanced Linux users find it lacking. Still Ubuntu makes a great platform for adapting to the Linux ways and learning some more advanced features.

One of the problems that I ran into quite frequently as a new Ubuntu user was logging into root. You see Ubuntu has no root account as a security measure. Instead everything for admin is done via the command sudo.

The problem with this is that all commands will function properly usung sudo. For instance if you type:

$>sudo cd /etc/sbin

in an attempt to open the sbin folder as a super user you will receive the following error message

$>/bin/sbin 'cd' unknown command

This is because there is no sbin command for cd and sudo calls sbin commands. This can be remedied by typing

$>sudo su -l root

This will log you in as root for that terminal session using your sudo password. This will enable you to access folders and files as root that may not normally work with a simple sudo command. When your done make sure you type


To log out of the root user mode.

And there you have it! A nice easy work around to one of the limitations of the Ubuntu system. Note that this will only work on a user account listed as a sudoer. An account without admin access will be unable to sudo at all let alone open a root shell session.

No comments: