LinuxQuestions.org
Review your favorite Linux distribution.
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 07-22-2011, 01:14 PM   #1
jsd12345
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
Unhappy root issue linux & Centos


Hi All! :-)

Brand new to this forum (and linux, though learning fast); I'm hoping you can save me....fast!

I forgot the root passwd for linux (via the "single" mode) and, according to all confirms, did so successfully!

I then try to log on to Centos as root, and I can't....it says "incorrect passwd"!!!

So then I log on as another, regular, but not root, user, with that passwd, and boot up into Centos.

HOWEVER....if I try to "su" to root, with the new root passwd, again it says its incorrect.

PLS help!1

FYI....there is no "system admin" passwd set....I checked!

Basically.....I need root access within Centos! (and Fedora, if that's different!)

Thanks!

Janie
 
Old 07-22-2011, 01:28 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,681
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
If you boot into "single user" mode (not known as simply "single") then it automatically puts you at a root prompt.

In the initial boot screen where it shows you a list of boot choices and says to press any key within 5 seconds just hit enter. Choose the kernel you want to boot and hit "e" then go to the end of line and put a "1" and exit back to the previous screen. Choose "b" to boot and it will boot your kernel into single user mode. Once it is booted in single user you should be able to change the root password by typing "passwd root" (or simply "passwd" since you're already root).

If it complains about not being able to write to the file then / (root) is mounted readonly and you can remount it as read write with: "mount -o remount,rw /"

There's more discussion about lost root password recover mechanisms at:
http://www.centos.org/docs/5/html/In...escuemode.html

P.S. Please do not put "URGENT", "IMPORTANT", "ASAP" or similar words in your titles. No one here is being paid to help you - it is all voluntary. Some users will ignore posts with such words in the title as it is considered rude.
 
Old 07-22-2011, 02:08 PM   #3
jsd12345
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks soooo much!

BUT....I am sorry I didn't make this clear! :-(

I have done EXACTLY what you said and reset the "root" password (reboot went fine (logging into Centos 5) as a "regular" (vs "root) user

These are my two problems:

After the success of above....upon boot....if I select "root" as my login, the password I just successfully changed, doesn't work!

Second, most important....when I'm in Centos (as mu "regular" user name,,,,if I do a "SU" to root, AGAIN my new password doesn't work!

Please help?! :-) I need to be "root" in centos AND in Linux Enterprise Server
 
Old 07-22-2011, 03:22 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,681
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
Does root not work on the console or in a terminal session or both?

When you run "passwd root" in single user what output do you see?

In single user you might want to verify /etc/passwd and /etc/shadow files are not corrupted. I'm guessing it isn't too bad given that you can login as a normal user. Sometimes what happens is there is a corruption a file such that entries above it work but entries below it don't. The root user should be first entry in both those files.

Did you make any changes to PAM configs? If so that could bork things up.

What is in your /etc/securetty file - this file restricts which terminals (and console) are allowed to login as root.
 
Old 07-22-2011, 08:17 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,990

Rep: Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448
root login to the gui is not supposed to work
root login to the TEXT only console should work
also you can not use the CAP spelling "SU" will not work Linux is capitalization sensitive
it is lowercase su
but root access will ALSO reguire the full root access an that will require this
Code:
 su -
gedit
" su - "
 
Old 07-22-2011, 09:23 PM   #6
jsd12345
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Follow-Up Still Need Help!

In answer to the first question, "root" login via my "new" pw doesn't work in either terminal or console! (in terminal I'm logged on as a "regular' user (to Centos) and am trying to "su" to root (no caps, all lower case!)

What is conusing now is you are talking about looking at files....and I don't know how to do that before full boot (again, to Centos)......and, of course, as "su" to root doesn't work....can't get to them then, either!

No changes to PAM or anything else!

Thanks

Janie
 
Old 07-23-2011, 03:53 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,990

Rep: Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448
what was the exact command you used for "passwd"

is it possible that "cap-lock" is set in the bios
that password might be all caps .
or "ROOT" might be being typed in and not "root "
 
Old 07-25-2011, 01:09 PM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,681
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
When I was talking about looking at files I meant after you booted into single user and got a root prompt. From what you'd written previously I thought you were able to do that. Is that not the case?

Once you boot into single user you can mount your other filesystems manually using the mount command but the files I was talking about are generally in /etc so are part of the root filesystem which is already mounted.

You didn't answer my question about EXACTLY what you saw when you typed "passwd root". You seem to be assuming it worked but I'm not willing to assume that given that you can't login after you do a normal reboot. Do NOT select what you like out of responses to your post - actually respond to all of it. Not doing so is likely to give folks a disincentive to help you further. There can be various reasons why it didn't work or why it did and something else is going on. Troubleshooting is about eliminating possibilities and so far you've not posted anything to let us eliminate the possibility your passwd command failed or that you were actually in single user.

When you get to single user type "who -r" and post the results. Then type "passwd root" and post the results.
 
Old 07-25-2011, 07:20 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
When you login to single user mode, use the cmd 'id' (without quotes). It'll confirm exactly who you are logged in as. Please post the output here.
http://linux.die.net/man/1/id
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Booting Centos 5.4 Issue: "CentOS CD Not found in any of the media drives. Please i g.navink Red Hat 1 04-07-2010 05:12 PM
CentOS Linux Postfix emails as root only nixster Linux - Software 1 02-26-2010 08:43 AM
Web Root Dir Change and New Dir Added issue in CentOS 5 Ginnyz Linux - Server 2 06-01-2009 09:29 PM
Issue with firewire drive on Linux (CentOS) nmurali2 Linux - Hardware 4 01-31-2006 09:25 PM


All times are GMT -5. The time now is 07:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration