Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-06-2007, 08:15 AM   #1
LQ Newbie
Registered: Jun 2007
Posts: 4

Rep: Reputation: 0
Unhappy ALL logins/passwords are rejected by CentOS

I wanted to pose this question prior to my doing research in the event someone may get back to me on this. When I boot CentOS, it goes through the "normal" displays and comes up to the login: screen. No matter WHAT login and password I use (which were set up in /etc/password and /etc/shadow), I get a message similar to "Invalid Password". (Sorry for not writing down the EXACT error message.) This is a SCHOOL project and I know it would be faster and easier to re-install CentOS, BUT I wanted to use this as a learning experience. WHAT IF this happened in real life? What would I do then? I want to find out how to PROPERLY do this, so in the future it would not be a problem if I REALLY had solve this type of problem.

I had saved /etc/passwd and /etc/shadow as .org files, so I copied these back over and rebooted, with the same results. I ALSO had copies of the files saved on a USB "stick", so I booted up with a Knoppix bootable cd. I was able to get into the CentOS directory structure without any problems. I unmounted all the drives and did a fsck, and they all passed. I copied over the /etc/passwd and /etc/shadow files from the USB to /etc. (/etc/passwd is rw-r-r root root and /etc/shadow is rw------- root root I think.) I rebooted CentOS and I stil have the same problem - no matter what login/password I use, it won't login.
(Over a period of a couple of weeks, I had added several different logins [at least 10]. There was root, student, rsmith, epoe, arice, sking, sshuser, techuser plus others I have forgotten. None of these now work.)

Being somewhat new to Linux, I am not technically sure WHICH files are used to confirm logins. There may be MORE files than those two, but those are the two I saved.

Sorry for going into verbose mode here, but I wanted someone to have a good unstanding of the way things are set up. I will research this site for possible answers, and search the web in general. I anyone knows, please get back to me. Thank you, Michael A Tipton
Old 07-06-2007, 08:28 AM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Unless some extra steps are taken (some extra security stuff, maybe), a "normal" shell login should only use /etc/passwd and /etc/shadow (the latter one for passwords stored and crypted) to check the login. Actually you should be able to create a new user account just by adding the relevant information there, plus creating a home directory if preferred. It the files are not what they should be, then it doesn't work.

root login should work always. If you have problems, and your BIOS (or BIOS password) doesn't stop you from booting from a livecd, or your bootloader doesn't ask you passwords (that you don't know) if you want to alter commands before booting, you can very easily reset root password and use that to reset the other passwords. Even simpler way is, if there is no bootloader password set (for GRUB, I don't use LILO anymore so I'll say nothing about it), to boot into single-user mode (runlevel number 1) which gives root login without password; then use passwd to set the passwords, or just check out what's wrong with the passwd and shadow files.


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
Inconsistent saving of logins and passwords in FF2 m_lp_ql_m Linux - Software 5 03-07-2007 02:41 AM
Valid passwords rejected by KDE Spamsonite Linux - Software 3 03-18-2005 09:56 AM
Sync MySQL passwords with local account passwords? turbine216 Linux - Software 2 02-18-2005 04:15 AM
Root & user logins : Passwords? Why not encryption keys instead? furfurdemon666 Linux - Security 4 07-02-2004 10:17 AM
Forgotten all passwords and logins! mobyuk Linux - Newbie 3 06-03-2004 06:17 AM > Forums > Linux Forums > Linux - Newbie

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

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