1

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$

5 Answers 5

5

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.

2
  • take note if you're not in the sudo ring, this will be useless as well.
    – setzamora
    May 28, 2009 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, 2009 at 22:31
2

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.

1

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.

1

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.

2
  • 4
    This is not recommended as this poses security threats. I recommend leaving the root password "unknown."
    – setzamora
    May 28, 2009 at 13:03
  • 1
    It's also wrong, you should do "sudo passwd" not "su passwd".
    – GodEater
    May 28, 2009 at 14:13
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .