168

I tried to su to root so I could install lights, but I get an authentication error when I try:

user@host:~$ su
Password: 
su: Authentication failure
Seth
  • 59,332
Michael
  • 2,597

5 Answers5

270

The root account is disabled by default in Ubuntu, so there is no root password, that's why su fails with an authentication error.

Use sudo to become root:

sudo -i  
Seth
  • 59,332
24

If su doesn't work, I do this (in bash):

user@host:~$ sudo bash
root@host:~# su
root@host:/home/user# 

Voila! You are now root!

A shortcut for this would be sudo su. In this case given that you are a member of /etc/sudoers with all privileges, then you would only need your user's password.

e.thompsy
  • 341
13

You are getting Authentication failure because you are trying to become root which is disabled by default in all versions of Ubuntu. This can be easily circumvented in two ways:

  1. Enabling the root account. This can be achieved by setting up a password.
  2. Instead of su use sudo -i or better yet, append to any command sudo in the way of:

    sudo apt-get update
    [sudo] password for braiam:
    

I wouldn't recommend enabling root, since it could raise a security concern, for example, if you use any service exposed to the web.

Braiam
  • 69,112
13

Open root with sudo -s and when it's in this mode type:

passwd

Then, choose password. This password will be for su command.

aastefanov
  • 1,399
4

Use sudo your_command in place of su.
ie

sudo apt-get install "program to install"
girardengo
  • 5,005