LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Unable to login as 'root' (https://www.linuxquestions.org/questions/linux-desktop-74/unable-to-login-as-root-601813/)

ajeetraina 11-23-2007 01:42 AM

Unable to login as 'root'
 
This morning I tried to login as root in fedora machine it throws:

sh-3.00 # passwd root
passwd:unknown user name 'root'

I checked the /etc/passwd file and it says:

root:x:500:500:/home/root:/bin/bash

I tried to change 500 to 0 and again tried.
But to my surprise,it threw the same error:
passwd:unknown user name 'root'

and the file /etc/passwd get changed to root:x:500:500:/home/root:/bin/bash again


Also ,I checked the root directory..its there?
If I run #useradd root
it says: useradd:unknown gid 100
No group "mail" exists,creating mail spool with mode 0600

Can anyone help me whats going on here.???????plzzz
I am stucked !!!!!

Simon Bridge 11-23-2007 02:24 AM

How about shadow: is installed, /etc/shadow exists, any indication that shadow libraries not properly installed or referenced (ldd on /etc/passwd shows /lin/libshadow.* refs when shadow is used)?

Can you "su -" to root?

ajeetraina 11-23-2007 02:47 AM

Ya ..shadow file exists.the contents are :
root:!:!:13840:0:999999:0:7:
bin:
daemon:
lp:sync:passwd.............all entries are there.


I ran #ldd /etc/passwd and it threw:
you dont have exception permission for /etc/passwd not a dynamic executable

#su -
su:user root doesnt exist


aNY IDEA??

b0uncer 11-23-2007 02:47 AM

Sounds odd, but this also looks odd:
Quote:

This morning I tried to login as root in fedora machine it throws:

sh-3.00 # passwd root
Two points: first of all, to be able to run 'passwd', you need to be logged in already. So if you were able to run it, you actually had logged in (and to be able to passwd root's password, you need to be root or have loose sudo rights). Second point: there's a # after the sh prompt, which (to me at least) looks like you are logged in as root. Now am I right, or is there something odd going on there too? The rest of the thing surely does look odd..

You haven't tried to clone the root user, or make another user have root ID (0) - because such things, when failing, could cause something like this. Read passwd trough and first of all make sure there is no other ID 0 user there..

If you can't figure out what it is, or suspect there's a possibility somebody got in and is causing that, a clean overwrting reinstallation of your OS is the way to go, to be fairly sure.

Quote:

root:!:!:13840:0:999999:0:7:
I'm not sure if that's a valid entry..the exclamation marks (!) don't usually belong there. Added to a password field, for example, effectively cause the password to be "unreadable", thus locking the account (but still it should be there, just not let you in). Maybe you could try clearing the password field (and maybe go trough the other fields and see that their information is correct, or at least looks correct) and see if it zeros the password information. But if you can access the shadow file, you're logged in as root or have your system pretty well wrecked up.

ajeetraina 11-23-2007 03:04 AM

I am logged in as single user .So its clear that sh# will be displayed.
Since I was not able to login as normal runlevel I logged in runlevel 1


All times are GMT -5. The time now is 11:47 PM.