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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
07-12-2012, 03:49 PM
|
#1
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Rep: 
|
Cannot Log in - Cent OS 5
This all started with an accidential unplugging of the box.
Upon reboot, I was getting errors:
Code:
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
I utilized a live USB key I had and ran:
Code:
fsck.ext3 -y /dev/VolGroup00/LogVol01
After a while, the disk check completed. Upon reboot, I am presented with the log-in prompt. Normally, I would log into this box under root. When I try to log in as root this time around, the prompt clears and nothing else happens (that I can see).
I have tried booting to single-user mode, but when I try 'passwd', I am told that the system can not identify me. If I try to view /etc/passwd, I am told that I don't have permission. Durring the process of booting to single-user mode, I see the following:
Code:
id: cannot find name for user ID 0
However, i can mount this drive and view /etc/passwd as well as /etc/shadow through the live usb.
Under /etc/passwd, root is listed as follows:
Code:
root:x:0.:0:root:/root:/bin/bash
Under /etc/shadow, I have the following:
Code:
root::15324:0:99999:7:::
I'm not sure where to go next as everything I've Googled seems to be solved well before this point.
Any further assistance would be greatly appreciated!!
Last edited by jbennett; 07-12-2012 at 04:10 PM.
Reason: additional information
|
|
|
07-12-2012, 04:12 PM
|
#2
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,376
|
As far as I know, the password would be between the first colon, and the second colon in the /etc/shadow file. It would appear to me there is no password set for root. Try logging in, and just press enter as a response to the password.
The passwords are encrypted, so you do not see your password there, just a string of characters.
If you can log in with no password, then you can change it after you're in.
|
|
|
07-12-2012, 04:15 PM
|
#3
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep: 
|
Unfortunately, it's not at the password prompt that I'm stuck, it's at the user prompt. Where you would normally type in the user that you want to log in as, I type 'root' and press enter. It just clears out and comes back to the same prompt.
|
|
|
07-12-2012, 04:25 PM
|
#4
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,376
|
Try to log as root from one of the TTY's. Press ctrl+ alt+ F1 to F6. One of those F keys and the others should get you a command line. User - root, and just press enter when it prompts for the password.
|
|
|
07-12-2012, 04:28 PM
|
#5
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,376
|
|
|
1 members found this post helpful.
|
07-12-2012, 04:39 PM
|
#6
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep: 
|
Quote:
Originally Posted by camorri
Try to log as root from one of the TTY's. Press ctrl+ alt+ F1 to F6. One of those F keys and the others should get you a command line. User - root, and just press enter when it prompts for the password.
|
I tried this at the log in prompt, but nothing happened. Reading up about it, it seems that I need to be logged in in order to access TTY? I am not using a GUI on this box, it is command line only.
|
|
|
07-12-2012, 04:43 PM
|
#7
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,376
|
Quote:
I need to be logged in in order to access TTY?
|
No, the tty's need only to be running. It would appear you have more wrong than the password.
Did you have a look at the how-to I posted? Can you get into single user mode?
|
|
1 members found this post helpful.
|
07-12-2012, 04:50 PM
|
#8
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep: 
|
Quote:
Originally Posted by camorri
|
When I try option #1 and try to boot to run level 1, I get the following:
Code:
INIT: Entering runlevel 1:
INIT: no more processes left in this runlevel
I am trying to boot using SystemRescueCD, and am at the prompt, but typing 'linux rescue' doesn't work (command not found), so I suppose I need to read a bit further.
|
|
|
07-12-2012, 05:29 PM
|
#9
|
Member
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65
Rep:
|
It would seem that your system isn't in a very consistent state and you might be better off re-installing in the absence of a backup. However, I have a couple of other points to note.
- The dot after the first zero is invalid - which might explain the "cannot find user ID 0" error.
Quote:
root:x:0.:0:root:/root:/bin/bash
|
You have access to the partition via a USB Linux setup so you can easily edit /etc/passwd to fix that.
- pwck(8) is another command to verify the integrity of password files.
- Since you can access the partitions you may be able to mount your root file system and chroot(1) to it. I thought I saw reference to a CentOS system, in which case you can use rpm(8) with --verify to check the packages to see which are broken and need re-installing.
- If I am correct in thinking this is a CentOS install I would recommend using the rescue option from the installation CD.
The latest INIT error sounds like another problem, implying other files in /etc are also broken. Last of all there could be some PAM configuration files ( /etc/pam.d/ or similar ) that are now broken too and this might also prevent login.
Hope this helps.
Grant
Last edited by whizzit; 07-12-2012 at 05:40 PM.
|
|
1 members found this post helpful.
|
07-12-2012, 06:19 PM
|
#10
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,376
|
|
|
|
07-12-2012, 06:19 PM
|
#11
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,434
|
I agree with the pts 1-4 by Whizzit.
You'll also want this http://www.cyberciti.biz/tips/reset-...ermission.html to rest the permissions etc on the files if reqd.
|
|
1 members found this post helpful.
|
07-13-2012, 08:32 AM
|
#12
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep: 
|
Quote:
Originally Posted by whizzit
- The dot after the first zero is invalid - which might explain the "cannot find user ID 0" error.
|
Unfortunately, I simply typed this inaccurately on the forum. If only it were that simple!!
Code:
root:x:0:0:root:/root:/bin/bash
Quote:
- pwck(8) is another command to verify the integrity of password files.
|
I opened the partition in question in terminal and executed 'pwck'. The result is as follows:
Code:
user 'adm' : directory '/var/adm' does not exist
user 'uucp' : directory '/var/uucp' does not exist
user 'gopher' : directory '/var/gopher' does not exist
user 'ftp' : directory '/var/ftp' does not exist
user 'avahi-autoipd' : directory '/var/lib/avahi-autoipd' does not exist
user 'pulse' : directory '/var/empty/saslauth' does not exist
pwck: no changes
This doesn't seem very promising.
Quote:
- Since you can access the partitions you may be able to mount your root file system and chroot(1) to it. I thought I saw reference to a CentOS system, in which case you can use rpm(8) with --verify to check the packages to see which are broken and need re-installing.
|
I'm not familiar with how to do this. I have found the following wiki article describing what I think is my application, but I'm unsure.
When I try to run the following command, I'm told that I must specify the filesystem type. I believe I'm ext3. Does this sound accurate?
Code:
# mount /dev/hda3 /mnt/gentoo
I should note that I'm using a livecd based off of CentOS 6, and am thus using the GUI to mount the drive as I'm more comfortable in this arena.
Quote:
- If I am correct in thinking this is a CentOS install I would recommend using the rescue option from the installation CD.
|
I will have to actually make this CD as I don't have one. The guy that built this system before I blindly took it over didn't leave anything behind when he left.
Quote:
The latest INIT error sounds like another problem, implying other files in /etc are also broken. Last of all there could be some PAM configuration files ( /etc/pam.d/ or similar ) that are now broken too and this might also prevent login.
|
I'm thinking a new install is going to be my best route as well.
Immensely!! Thank you so much!
Last edited by jbennett; 07-13-2012 at 08:33 AM.
Reason: formatting
|
|
|
07-13-2012, 10:38 AM
|
#13
|
Member
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65
Rep:
|
Quote:
Originally Posted by jbennett
I opened the partition in question in terminal and executed 'pwck'. The result is as follows:
Code:
user 'adm' : directory '/var/adm' does not exist
user 'uucp' : directory '/var/uucp' does not exist
user 'gopher' : directory '/var/gopher' does not exist
user 'ftp' : directory '/var/ftp' does not exist
user 'avahi-autoipd' : directory '/var/lib/avahi-autoipd' does not exist
user 'pulse' : directory '/var/empty/saslauth' does not exist
pwck: no changes
This doesn't seem very promising.
|
Those are typical/standard errors that I come across. However, this is probably checking the /etc/passwd of your live CD because I neglected to mention that it would only be useful if already chrooted into your CentOS system; sorry.
Quote:
Originally Posted by jbennett
I'm not familiar with how to do this. I have found the following wiki article describing what I think is my application, but I'm unsure.
|
Sure - it can be done with a live CD but life is going to be much easier using the rescue function of the original CentOS CD. I am thinking more along the lines of the documented rescue steps on CentOS's website*. It does mean working with the command line (terminal or console) for a bit but I think that is unavoidable right now.
( * credit to camorri for first posting this link in comment #10 )
If you are going to be looking after this system for the foreseeable future it will be worth keeping a rescue CD (install CD) around. Grab an ISO from http://vault.centos.org for your specific 5.x release and architecture if your bandwidth allows. The rescue ability is built in as described the the CentOS documentation in the link above.
( the CentOS LiveCD may have the same rescue features, I don't know, but the bin-1ofX versions will have for sure )
Quote:
Originally Posted by jbennett
When I try to run the following command, I'm told that I must specify the filesystem type. I believe I'm ext3. Does this sound accurate?
Code:
# mount /dev/hda3 /mnt/gentoo
|
Quite probably ext3 and most likely there will be logical volumes meaning the mount will need to be something more like...
Code:
# mount /dev/VolGroup00/LogVol00 /mnt/sysimage
...assuming LogVol00 is the root file system.
Again, the CentOS rescue feature is your friend here as it will auto-detect which logical volumes or real partitions need mounting and mount them for you
Quote:
Originally Posted by jbennett
I'm thinking a new install is going to be my best route as well.
|
It seems clear the there are other issues beyond gaining login access to the booted CentOS install. It is a good opportunity to learn from a real world problem to gain some confidence and satisfaction so the choice is yours depending on how you value your time and what pressures you have to make a working system.
Or you might decide that now is a good time to upgrade to a 6.x release.
Quote:
Originally Posted by jbennett
Immensely!! Thank you so much!
|
You're welcome!
Last edited by whizzit; 07-14-2012 at 08:37 AM.
Reason: Adding credit for camorri for CentOS link
|
|
1 members found this post helpful.
|
07-17-2012, 10:44 AM
|
#14
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep: 
|
Ok - so I've come back to these disks to try and rescue them.
I have downloaded CentOS 6.2 DVD1 iso image.
Upon booting to the DVD, I don't have a rescue option? I have an option to install, and then I can edit the command line, but I don't want to wipe and reinstall on these disks (I've already done a fresh install on another disk).
Did I grab the wrong iso image?? Is there a different one for rescue/recovery and I just missed it?
|
|
|
07-17-2012, 10:56 AM
|
#15
|
Moderator
Registered: Aug 2002
Posts: 26,758
|
You need to type "linux rescue" at the "boot:" prompt.
|
|
|
All times are GMT -5. The time now is 02:07 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|