Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

While updating my gentoo linux box, I managed to mess up PAM. Now I can't login!

Here's the message I get

login: <I type my name, enter>
/bin/login: error while loading shared libraries: 
              libpam_misc.so.0: cannot open shared object file: 
                No such file or directory

login: <repeat>

I think I need to boot in single user mode but how do I do that?

Don't worry about PAM--I'll figure that out once I can get some control of the system. If I need to use a live cd, I'll have to wait until tomorrow as I don't have any handy.

Update: I tried adding to grub's kernel line

init=/bin/sh real_init=/bin/sh

and that helped. Now I get dumped to a shell pretty much right away. The problem now is that my keyboard doesn't work! It's USB...

Update: Adding these to the kernel line also don't work:

init=/bin/bash real_init=/bin/bash (no keyboard)
init=/bin/bb   real_init=/bin/bb   (kernel panic)
single (no change--original problem persists)
share|improve this question

3 Answers 3

up vote 6 down vote accepted

If you are using GRUB as a boot manager, stop the boot at the boot menu. Highlight the kernel you boot into and hit the 'e' key to edit the line. Add the option "single" at the end of the line and it will boot into single user mode.

If that fails, boot into a LiveCD and use that environment to mount your drive and fix the necessary files you need in order to fix PAM

share|improve this answer
    
Ah--it worked this time! I must have been messing it up before. I swear I tried 12 different permutations of 'single' + kernel line... –  Michael Haren Jul 2 '09 at 2:41

I'd go for the rescue / live CD? >smile< W/ your keyboard problem, that may be easier. If you've got a thumb drive on you, go grab one of the various thumb-drive Linux distros, write it to the thumb drive, and you'll be back in business.

share|improve this answer
    
Yes, I guess I should just call it a day and burn one tomorrow... –  Michael Haren Jul 2 '09 at 2:38
    
I managed to get in with 'single'. Thanks for the tips, though. –  Michael Haren Jul 2 '09 at 2:44

If single user mode doesn't work, you can always try booting with /bin/bash as init. Boot into grub, press e, and edit the boot line to have init=/bin/bash. You'll boot into a system with nothing else running, and will have to manually remount filesystems, so it's better to go for single user mode if possible.

share|improve this answer
    
I tried this. It's noted in my question. –  Michael Haren Jul 2 '09 at 19:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.