Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I get root access from shell? When I'm trying to use su I get:

    default@default-laptop:~/home/default$ su
    Password: 
    su: Authentication error
    default@default-laptop:~/home/default$
share|improve this question
add comment

5 Answers

up vote 5 down vote accepted

su wants the root password, if you're running Ubuntu that will be scrambled. Try sudo -s -H or sudo su - and give your user password.

share|improve this answer
    
take note if you're not in the sudo ring, this will be useless as well. –  Joset May 28 '09 at 13:02
    
If your user account is an "Administrator", the sudo su works great. Sometimes I use a series of sudo [command], and sometimes I just sudo su and then enter the [command]. Seems to work fine. –  pcapademic May 28 '09 at 22:31
add comment

On Ubuntu, an easier way is to use the following command:

$ sudo -s

This tells sudo to launch a shell. Make sure that you are in the admin group on Ubuntu. You can check your groups by using:

$ groups

If you are not in the group, you can add yourself by using the following

$ sudo gpasswd -a <username> admin

Also to note, on a default Ubuntu install, root's password will be the same password as the default user.

share|improve this answer
add comment

On non-Ubuntu systems, you will need to ensure that your username is part of the "wheel" group in the /etc/group file. See "man group" for syntax, etc.

share|improve this answer
add comment

On a default Ubuntu installation you cannot su as root. You can use sudo to launch any command you need.

You can also do

sudo passwd

after entering your password you will be able to give root a password. After you will be able to su as root.

share|improve this answer
4  
This is not recommended as this poses security threats. I recommend leaving the root password "unknown." –  Joset May 28 '09 at 13:03
1  
It's also wrong, you should do "sudo passwd" not "su passwd". –  GodEater May 28 '09 at 14:13
add comment

su requires the root password

sudo su will accomplish the same thing, with your own password (not root's) - but you have to be set up properly in advance to do this.

Some distro's like Ubuntu give the first user full sudo access. Others, like Debian, require you to set up the root account during the install.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.