Category: Linux

  • Ubuntu and sudo

    Ubuntu disables access to the root account by default, for reasons which have never been particularly clear to me. They deem it preferable to give users sudo access, which is all well and good, but typing a series of commands, all prefixed by ‘sudo’, can be very tedious.

    Fortunately, there are a few ways around this.

    The first is to use a super user shell. From a terminal or console, type:
    sudo bash
    This will give you a shell with full root access, and save you needlessly typing ‘sudo’. (You can, of course, use other shell flavours, like zsh or csh if you prefer.)

    A similar method is to run the ‘su’ command with sudo, thusly:
    sudo su
    which will also give you a shell with full root access, according to root’s preferred shell.

    The third method is to alter the password protecting the root account. To do this, from a terminal or console, type:
    sudo passwd root
    and enter a password for the root user. Now you will be able to log on to consoles (and, if you’re that way inclined, X sessions) as root.