I can't su as root, my account type is admin BUT am I root?

16,298

Solution 1

While using Terminal, Just prefix sudoto the command that you want to execute as root. Authenticate it with your user password.....

For example, to install curl, via the root privileges, execute this

sudo apt-get install curl

In ubuntu, the root account does exist, However it is not activated by default. Tough you should avoid this, but if you want to login using the root account, the this is the workout.

sudo -i
sudo passwd root

replace "passwd" with the password of your choice that you want for the "root" account.

Solution 2

Why do you need to run as root?

The main difference between Ubuntu (and many other Unix OS') and Windows is that the root account isn't accessible like any other. That is, the password is set to be impossible to enter (Geeks see footnote). If you want to run a program with root privileges, open a terminal and run sudo (program), or gksudo (program) if it's graphical.

The root account is "disabled" for various reasons, all mainly security related.

Footnote: Hashed passwords are stored in /etc/shadow, and the root account password hash begins with a !. Since no possible value can be hashed to begin with a !, there is no possible value which can match the root password. (Alternatively, Linus Torvalds knows all the root passwords.)

Share:
16,298

Related videos on Youtube

Community
Author by

Community

Updated on September 18, 2022

Comments

  • Community
    Community over 1 year

    Possible Duplicate:
    su command + authentication failure

    i installed ubuntu successfully, but then i tried "su" on terminal and entered my password, authentication failed! and I don't think that i'm root, I don't have root permissions, what should I do ? ... I went to user accounts, it says my account type is Administrator, but that's not root is it ??

    thanks :)

  • BlitZz
    BlitZz almost 12 years
    Alvar: in Ubuntu, by default, if the user is in the "sudo" group, he can run commands as root with su by entering his password, rather than root's. You're right that sudo requires root's password but as explained in other answers, this doesn't work by default on Ubuntu.
  • jackweirdy
    jackweirdy almost 12 years
    Alvar, see my post as to why the root password doesn't "exist"
  • jackweirdy
    jackweirdy almost 12 years
    Also, enabling the root account is (99% of the time) a very very silly thing to do as it means there's an account on your computer which can do anything.
  • jackweirdy
    jackweirdy almost 12 years
    Only problem with sudo -i is you lose your shell history, for example if you sudo -i; foo; bar; you won't be able to press the up key and see what you did when you return to a normal shell, whereas by running sudo foo; sudo bar; you can
  • BlitZz
    BlitZz almost 12 years
    hm, if I run sudo -i and then run several commands within the root session, then exit, and sudo -i again, story is all there. This is what I was suggesting. :)
  • jackweirdy
    jackweirdy almost 12 years
    What I'm saying is if you don't sudo -i you can't see it again. This is a problem when your boss breaks something and you can't see what he did to fix it :(
  • Michael Durrant
    Michael Durrant almost 12 years
    +1 roadmr, that's the way it works. I recommend deleting Alvar's comment as, no offense, but it is wrong and might mislead a casual reader.
  • Alvar
    Alvar almost 12 years
    @MichaelDurrant sorry I was wrong then. Always fun to learn new things! :)