Here's a troubleshooting question...

Soldato
Joined
9 Dec 2004
Posts
5,700
Location
Dorset
Hi everyone,

A nice troubleshooting question for you;

I have just migrated one of my physical Red Hat 5 boxes into a virtual machine. All went fine and it boots without issue, the thing is that when I try to login as a user - it immediately dumps me back at the login prompt. Log files don't reveal anything other than a successful login then a successful logout.

I've checked /etc/passwd to ensure my users have a shell, also checked my binaries (/bin/bash etc). I'm a bit puzzled now...

Any other thoughts?

Thanks :)
 
Is there something fishy in /etc/profile /etc/bash.rc ?

What if you try su ing the user from a different ont, any odd output?
 
Profiles and bash.rc / cshrc etc are all fine for users. Can't su to the user due to being unable to login.

From a rescue CD I've inspected everything I can think of :S
 
Ok, after trying to login lots of times I got to the respawning too fast message.

this showed an error:

'Login: no shell: permission denied'
 
Odd to have no shell when it's set in /etc/passwd.

I meant login as your user and "su <user>" is it still the same issue?

Is there a space at the end of the /etc/passwd /etc/shells line?

cat normally won't display these characters, you could try cat -vet /etc/passwd
 
stupid keyboard, lost capitals.

i can't login as another user, same problem with all users.

have tried cat -vet and the end of line character exists, so that checks out fine.....
 
Um, are the permissions correctly set for all your login stuff? Binaries and config files as well.

I take it your trying to login using the console (ttyX) ? Have you tried changing your shell to something else temporarily in /etc/passwd ?
 
ok, bit miffed now. i just ran the passwd command to change one users password. i then rebooted and logged in as root - and it logged in ok. log in as the user whos password i changed, that was fine too....
 
I was gonna suggest you strace /bin/login :] See what exactly it was doing haha.
 
ahhh, caps working now :)

Do you know how I can do that if I can't login. Is it possible to run the strace command from a rescue CD / Live CD on a login attempt? :S
 
use any live CD and chroot into your installed partition if this happens again, then you can change whatever to fix it
 
Hmm ok, im bored.. gonna patch /sbin/getty which calls /bin/login so I can strace it. Want to see if its doable :p
 
After all that, nailed it. Turning off SELinux fixed it, I guess during the copy process it didn't retain the file contexts. Now to relabel the filesystem and see if that fixes it.
 
Relabelling also works. Question is, if I relabel the FS - will it apply my SELinux contexts etc as per my previous configuration? Or will it wipe everything to a `factory default`.
 
Back
Top Bottom