Ubuntu: I can't su as root, my account type is admin BUT am I root? [duplicate]



Question:

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 :)


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.)


Solution:3

If you want to "log in as root" (i.e. enter an interactive session as the root user), you can use this:

sudo -i

In Ubuntu, if you're in the "sudo" group, you can even "become" any user on your system:

sudo -i -u whoever

su doesn't work because it requires you to know root's password, which as jackweirdy explains, is not set on Ubuntu. I second his advice about not enabling the root account (it can certainly be done), as it's much more secure to use sudo only when you want to run privileged commands, and use your normal account otherwise.


Solution:4

If you deadly need root privileges and don't want to use sudo prefix, you can enable root account. Simply run

sudo passwd root

from your terminal and give password you want. Then log out, choose "other user", type name - "root", password you gave and log in.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »