LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-02-2009, 05:19 AM   #1
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Rep: Reputation: 0
Unhappy Unable to login. Doesnt accept password.


Hello Everyone

I have dual boot windowsxp Sp2 and Fedora 8 (2.6.23.1-42,fc8).I changed my root password by the following method:
1. boot linux kernel: init=/bin/sh
mount -o remount,rw /
/usr/bin/passwd

after changing my root password it said 'Authentication token updated sucessfully'

The problem now is i am unable to login either as a root or as a normal user.It doesnt accept any of the user passwords including root. So I then tried the following method to change my root password.

2. booting kernel: runlevel 1 (single user mode)
passwd : It says'changing passwd for user root.
unix_chkpasswd[1485]: check pass; user unknown.
passwd : Authentication token manipulation error.

So am not able to change the password this way.

Also i tried reading other similar threads and found a way to do it by modifying etc/passwd file. But to my dissappointment cannot make changes in /etc/passwd file when i login into single user mode. when i type command 'who' i get no response other than the prompt.when i do 'su' my prompt changes to [root@null]#

Now i dont know how to log into my system.
Please help me.
 
Old 05-03-2009, 04:40 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Quote:
unix_chkpasswd[1485]: check pass; user unknown.
Doesn't sound good (especially with the root account).

Boot into single user mode and ensure that the root account exists:
Code:
grep '^root:' /etc/passwd
grep '^root:' /etc/shadow
The first command should show:
Quote:
root:x:0:0:root:/root:/bin/bash
The second should show something like:
Quote:
root:$1$raNd0M$tR1ng:13813:0:99999:7:::
Do not post the encrypted password (second field in the second output)
 
Old 05-03-2009, 10:07 PM   #3
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for replying. I had lost the hope of getting any reply.

Sorry to reply so late.

before i enter the single user mode, it prints
MAKE DEV: no such user as root
MAKE DEV: no such user as root

id: Cannot find name for user ID 0

After entering the single user mode i typed the following commands and got this:

sh-3.2# grep |^root:' /etc/passwd
>

sh-3.2# grep |^root:' /etc/shadow
>

Absolutely nothing other than the greater than sign.!!!

Also when i do su, it says su: user root does not exist

I am so screwed. what should i do?
Thanks.
 
Old 05-04-2009, 02:29 AM   #4
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Please have a look again at my example.

I did not use the | (pipe) symbol but an ' (openning single quote)

The reason your command continued the way it did, was because it only had one ' symbol on the line and thought you wanted to continue onto the next line.

EDIT:
If there really is no root user in these files.
You need to add an entry for root in /etc/passwd and /etc/shadow
As I am not sure if you know how to use vi, I am going to append the entries to the files by redirecting echo statements to append to the file.

Make backups of these files first.
Code:
cp -p /etc/passwd /etc/passwd.20090504
cp -p /etc/shadow /etc/shadow.20090504
echo "root:x:0:0:root:/root:/bin/bash" >> /etc/passwd
echo "root:$1$raNd0M$tR1ng:13813:0:99999:7:::" >> /etc/shadow
diff /etc/passwd /etc/passwd.20090504
diff /etc/shadow /etc/shadow.20090504
Then reset your root passwd:

Code:
passwd

Last edited by Disillusionist; 05-04-2009 at 02:41 AM.
 
Old 05-04-2009, 03:46 AM   #5
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Smile

Certainly got the syntax wrong!

Will check and let you know later as i am at work.

Thanks
 
Old 05-04-2009, 11:48 AM   #6
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Smile Got an output!

I just checked the following commands in single user mode:

grep '^root:' /etc/passwd
root:x::0:root:/root:/bin/bash

grep '^root:' /etc/shadow
root::14363:0:99999:7:::

The second field in the second output is as it is. It is blank

What else should i try out. Please let me know.
 
Old 05-04-2009, 03:16 PM   #7
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
The second field in the /etc/shadow file should contain the encrypted password.

If you modify the /etc/shadow entry for the root account to:
Quote:
root:$1$Ab2S4$wqTstArvWel4bnUz4keGN.:14363:0:99999:7:::
That should set your root password to TestPass1

Once you have managed to log in with the root account, you can change the password
 
Old 05-04-2009, 10:16 PM   #8
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Hi,

I changed the second field in the /etc/shadow entry for the root account to:
root:$1$Ab2S4$wqTstArvWel4bnUz4keGN.:14363:0:99999:7::: As you had mentioned.
by vim editor.

And the output grep '^root:' /etc/shadow shows root:$1$Ab2S4$wqTstArvWel4bnUz4keGN.:14363:0:99999:7:::

But am still not able to login as root. When i try to do su - root
it says 'user root does not exist'

And when i try to login through the console mode it says wrong username or password though i gave password as TestPass1.

And i noticed something during boot, it prints 'cannot open database infomation for current process UID'. Unknown user??? no memory or space to allocate. Can this help!

Thanks. Please let me know what do do?
 
Old 05-05-2009, 12:14 AM   #9
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Do you have SELINUX turned on?

I think it's on as the default in Fedora.

Please post the contents of /etc/sysconfig/selinux
 
Old 05-05-2009, 02:37 AM   #10
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Fine...

will check and let you know later in the evening, after work

Thanks for replying.
 
Old 05-05-2009, 11:03 AM   #11
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Hi Disillusionist, Back again...

I tried the following in single user mode.
sh-3.2#/etc/sysconfig/selinux
sh: /etc/sysconfig/selinuxermission denied

Thanks once again for replying. I am so screwed, cannot login to my system.
Please help.
 
Old 05-05-2009, 01:19 PM   #12
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Try:

Code:
cat /etc/sysconfig/selinux
modify the entry for:
Quote:
SELINUX=
to be:

Quote:
SELINUX=disabled
Then reboot


EDIT:

Try changing the root entry in /etc/password first (as per the following post)

Last edited by Disillusionist; 05-05-2009 at 03:37 PM.
 
Old 05-05-2009, 03:14 PM   #13
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Just noticed something in one of your previous posts:
Quote:
Originally Posted by veerloh View Post
I just checked the following commands in single user mode:

grep '^root:' /etc/passwd
root:x::0:root:/root:/bin/bash
Should be:

root:x:0:0:root:/root:/bin/bash

If your entry wasn't a typo, then that would explain why you cannot log in as root.
 
Old 05-05-2009, 11:00 PM   #14
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Thumbs up Hurray!

What a delight. I am able to log into my system finally.

Thank you so much Disillusionist, really appreciate your efforts.

I did exactly what you said and was able to log in. And later i tried to modify the /etc/sysconfig/selinux to enforcing, just to see if it will work too and it did.

However am not able to change the user passwd
passwd VeeR
passwd:user Veer does not exist

Also the users which i delete and recreate again with the same name leads me to a failure. it says skel dir cannot write into the home directory of that user.

So i tried to delete the home directory for that user but could not. its not an empty directory. SO tried rm -rf to all files in that particaular dir which worked but two directories are still remaining.Which are
.
..

How should i do it?


THanks once again
 
Old 05-06-2009, 12:49 AM   #15
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
If you run:
Code:
ls -l /home
Please post the output and also grep /etc/passwd /etc/shadow for the relevant user names (same as you did for the root account)

EDIT:
Please continue onto next Page

Last edited by Disillusionist; 05-06-2009 at 01:13 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to login --- Can't enter the password. paragkalra Linux - Software 13 02-13-2018 04:31 PM
Samba SWAT doesnt accept Root Password or User name Matt Perrgo Linux - Newbie 2 07-25-2008 02:33 AM
password correct but..unable to login?? venki Linux - Newbie 6 01-12-2007 12:51 AM
rsh doesnt accept connections Xris718 Linux - General 3 05-19-2005 02:14 PM
Unable to login (no password prompt) T4urus Linux - General 1 12-21-2003 01:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration