LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I can't login as root... (https://www.linuxquestions.org/questions/linux-newbie-8/i-cant-login-as-root-710758/)

QueenZ 03-11-2009 10:53 AM

I can't login as root...
 
OK when i start up my computer, gdm shows and asks me for my username and password. I give it my username and password and it works but when i give it root and root's password it says incorrect username or password..

But i can do sudo su and then i give it root's password and it works

I can't do su - or su root

Could someone explain me what is going on here?

Quote:

creep@creepy-desktop:~$ su -
Password:
su: Authentication failure
creep@creepy-desktop:~$ su root
Password:
su: Authentication failure
creep@creepy-desktop:~$ sudo su
root@creepy-desktop:/home/creep#

Kubuntu 8.10 KDE 4.2.1

akuthia 03-11-2009 11:18 AM

((dont quote me on this)) I dont THINK "root" is an actualy\ user, per se, but rather, more like a permissions level or group. The whole gorup then uses the password for anything that needs root level access...

QueenZ 03-11-2009 11:30 AM

If there is an entry in /etc/passwd then that user is said to exist. Root even has it's own home direcotry.. that MUST be a real user i just can't figure out why won't it let me login.. I remember installing slackware and it said i can now login as root and it worked so it's definitely a user..

any ideas..?

Maligree 03-11-2009 11:46 AM

Whatever distro you're using (looks like something Ubuntuish) obviously the root account is "disabled". If you want to activate it, run..
Code:

sudo passwd
and set a password for root.

By the way, graphical login for root is disabled by default.

kasunbg 03-11-2009 12:06 PM

Of course root is also a user with all the privileges. As Maligree mentioned graphical log-in for root is disabled by default. It is done for your own safety. Because with root privileges you can edit any system file and even delete them. This is really dangerous and therefore root should not be used as your regular user account.

The thing with sudo and su is bit different.
When you use sudo command(ex.
Code:

sudo kate
Kasun@kasun~cse:~$ sudo kate
[sudo] password for Kasun:

) it asks for the current user's password.
But when you use su it asks for root password.
Code:

Kasun@kasun~cse:~$ su
Password:
root@kasun~cse:/home/Kasun#

If you have several users with admin rights, the root password will be the last added user's password.
But you can manually change the root password.(for kubuntu goto Applications->System->Kuser)and click on root account and set a new Password.

hth :)

QueenZ 03-11-2009 12:11 PM

One question. I was looking at the /etc/shadow file and i see that the password for root is '!'.. what does it mean? Doesn't '*' mean no password?

Quote:

root:!:14307:0:99999:7:::
So how can i enable graphical root login?

SkinnerC 03-11-2009 12:11 PM

In the *buntu family, root is not allowed to log in graphically.

Also, to change to root you will have to type in
Code:

sudo su
. Then enter root's password.

Lee_Ball 03-11-2009 12:29 PM

SkinnerC is half right, when using sudo the password you should be entering is your password.

Lee_Ball 03-11-2009 12:30 PM

Quote:

Originally Posted by QueenZ (Post 3471981)
One question. I was looking at the /etc/shadow file and i see that the password for root is '!'.. what does it mean? Doesn't '*' mean no password?

So how can i enable graphical root login?


If you're using Ubuntu you could always:

sudo su
Enter your password

This should give you a # root terminal

Then do:

passwd
enter a password you want for root

Log out and login with root and the password you just set.

QueenZ 03-11-2009 01:29 PM

Looks like all i had to do to enable root login was to set the password for root so i used KUser to do that and i can now login as root! YAY! :)

SlowCoder 03-11-2009 02:20 PM

Quote:

Originally Posted by QueenZ (Post 3472063)
Looks like all i had to do to enable root login was to set the password for root so i used KUser to do that and i can now login as root! YAY! :)

But for what reason do you feel you must be logged in directly as root? General practice is to log in under your own account, then use the console to sudo into root. This way you have much less likelyhood of running something that could damage your system as a normal user.

ronlau9 03-11-2009 02:23 PM

Quote:

Originally Posted by QueenZ (Post 3472063)
Looks like all i had to do to enable root login was to set the password for root so i used KUser to do that and i can now login as root! YAY! :)

What is so exciting in login as root ?

tredegar 03-11-2009 02:32 PM

Quote:

i can now login as root! YAY
You are logging into the GUI as root?

You are misguided. A quick search will explain why.

Good luck.

QueenZ 03-11-2009 02:35 PM

haha actually i just wanted to know why i wasn't able to log in as root. I'm new to linux and i want to know everything haven't you been there ? :) I don't actually need to log in as root but now i see why i wasn't able to :)

Cheers!

QueenZ 03-11-2009 02:38 PM

A quick search got me nowhere.. :D

Don't login as root - Google search


All times are GMT -5. The time now is 10:41 AM.