Root default shell incorrect

The root default shell is defined incorrectly in the /etc/passwd file and thus when I try and log in as root I get a NO SHELL error and get logged out..

Anyway of fixing this - as I dont have a session logged in as root currently and I am unable to initiate a new session as I keep getting the error above??

Is there no easier way to carry this out as I do have the root password - I just need to modify the /etc/passwd file or use admintool to correct the incorrectly defined default shell for the root user

There is no other way to do it. You have to boot into single user from the cd to correct errors on the root account, correct corrupt password / shadow files, fix / partition problems when the system won't boot and other assorted fun fixes.

ah - its okay I got lucky...
small security hole on the server I am using let me get root to submit a script to copy a modified passwd file in over the existing one...

Thank god!

Another possible option in this case would have been logging in as somebody else, then using sudo to become root using their password. Of course, if you didn't have sudo set up already you couldn't do that.

Hmmm, one other thought I had, but don't know for sure. What if you did a su root *without* the dash that tells it to use root's environment. Would it leave you in the original user's shell, or try to put you in root's login shell and thus not work?

I don't wanna mangle a machine to find out, but it might have worked. If I'm ever in that situation I'll definately try it.

Hi

I dont have sudo installed... I tried to su without the dash but it tries to initiate a new shell (the root users default shell) and thus fails with the same NO SHELL error..