LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ALL logins/passwords are rejected by CentOS (https://www.linuxquestions.org/questions/linux-newbie-8/all-logins-passwords-are-rejected-by-centos-567093/)

michaeltipton2222 07-06-2007 07:15 AM

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

b0uncer 07-06-2007 07:28 AM

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.


All times are GMT -5. The time now is 05:49 AM.