I can't su as root, my account type is admin BUT am I root?
Solution 1
While using Terminal, Just prefix sudo
to 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.)
Related videos on Youtube
Community
Updated on September 18, 2022Comments
-
Community over 1 year
Possible Duplicate:
su command + authentication failurei 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 almost 12 yearsAlvar: 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 almost 12 yearsAlvar, see my post as to why the root password doesn't "exist"
-
jackweirdy almost 12 yearsAlso, 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 almost 12 yearsOnly problem with
sudo -i
is you lose your shell history, for example if yousudo -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 runningsudo foo; sudo bar;
you can -
BlitZz almost 12 yearshm, if I run
sudo -i
and then run several commands within the root session, then exit, andsudo -i
again, story is all there. This is what I was suggesting. :) -
jackweirdy almost 12 yearsWhat 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 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 almost 12 years@MichaelDurrant sorry I was wrong then. Always fun to learn new things! :)