1843996 Members
2340 Online
110226 Solutions
New Discussion

Root shell invalid

 
SOLVED
Go to solution
Vassilios
Frequent Advisor

Root shell invalid

Hi all:

I accidentally changed the root shell , in the /etc/passwd file, to a path that doesnt exist. I get NO SHELL response from the system when i try to login, or su from a different user.

What can i do? Can i do su root -c "some command to force a new shell path". Does anyone know of that command syntax?

I prefer to do something like use the su command , or ftp command to change the password file, but nothing is working. I dont want to reboot using a new media. I have the boot CDROM, but i cant boot to single user mode; To boot into single user mode, u need to be logged in as root.

Thanks
41 REPLIES 41
Luk Vandenbussche
Honored Contributor

Re: Root shell invalid

Hi,

You must boot into single user mode to change /etc/passwd again.

Stop you applications and power down the server. Restart the server and go into single user mode
Chan 007
Honored Contributor

Re: Root shell invalid

Hi,

You can try to boot with single user mode. It will not ask you to login, as this is a maintenance boot mode. So don't worry. Just boot in the single user mode.

Once you at at #, just vi /etc/passwd and change that. Some times you may need to mount /usr and /var.

Ensure that you are logged/access console via MP or GSP or directly the console.

Chan

Vassilios
Frequent Advisor

Re: Root shell invalid

Hi. I cannot stop any applications, the only user with any permissions to do any of that was in fact root.

When I just press the power button, to powerdown the system, at what point do i need to make sure i get into single user mode.

Thanks
Fabien GUTIERREZ
Frequent Advisor

Re: Root shell invalid

if you have sudo configured you can get rid of this problem with a sudo vipasswd.
Vassilios
Frequent Advisor

Re: Root shell invalid

OK.. look i've gotta come clean here, i didnt want to say anything, but this is a sun V220 server. I love HP, i think HP are the best, but the SUN support forum is closed.

Long live HP.

Can i still get support?

Thanks
Arunvijai_4
Honored Contributor

Re: Root shell invalid

Hi,

Take a look at these threads,

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=594770
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=82975

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
MarkSyder
Honored Contributor

Re: Root shell invalid

When the system is on its way back up you will get a message giving you 10 seconds to press any key to interrupt the boot. You then need to type:

bo pri

Interact with IPL? answer y

when you get a prompt type:

hpux -is

This will take you into single user mode.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
MarkSyder
Honored Contributor

Re: Root shell invalid

I've just seen your reference to Sun (it wasn't there when I started typing my answer).

I have no knowledge of Sun and do not know how to boot into single-user mode in it.

Mark
The triumph of evil requires only that good men do nothing
Chan 007
Honored Contributor

Re: Root shell invalid

Have you tried

sytem# su (only) from other user instead of su -

That option will login without using the shell.

Chan
Luk Vandenbussche
Honored Contributor
Solution

Re: Root shell invalid

Vassilios,

You need your solaris installation media to solve this problem on a sun server.
Borislav Perkov
Respected Contributor

Re: Root shell invalid

Hi,
If you can't reboot the system in single user mode from command, push reset bottom, interrupt the booting proces and on OK prompt type boot -s to enter the single user mode then you can make the changes.
Regards,
Borislav
Vassilios
Frequent Advisor

Re: Root shell invalid

Hi,

The question is: How do i interrupt the boot process?

I pressed the reset button, and there is no 10 second grace period to enter the maintenance mode (as on HP)

Moreover, i'm connected using a PC as a console: i.e there's no STOP+A button.

This is a nightmare,

Thanks,
Borislav Perkov
Respected Contributor

Re: Root shell invalid

In that case if you using the serial port you shut enter Ctrl+Break and you will go in OK prompt
Borislav Perkov
Respected Contributor

Re: Root shell invalid

ops shut -> should
Borislav Perkov
Respected Contributor

Re: Root shell invalid

Borislav Perkov
Respected Contributor

Re: Root shell invalid

Vassilios
Frequent Advisor

Re: Root shell invalid

Hi. It says that I should use the break key. I'm in sweden, there are no break keys,
We've got control keys, escape keys etc, but no break key.

I pressed ESCAPE+CTRL KEY, and what happens is that it launches the microsoft start menu. Please help? This is a desperate situation. Thank you everyone
Borislav Perkov
Respected Contributor

Re: Root shell invalid

ARE YOU CONNECT TO SERIAL PORT ON THE SERVER?
IF YOU ARE, TRY Ctrl+Pause. Else you can't do it from network connection and without installation CD. Sorry
Vassilios
Frequent Advisor

Re: Root shell invalid

Hi.
OK. I found an application that gets me into the OK prompt.
Once i'm in the OK promot, do i do a

boot cdrom -s
or
boot -s

I mean, if i just boot into single user mode, do you think that should be OK?

If i boot from CDROM, what happens from there?

Thanks again
Borislav Perkov
Respected Contributor

Re: Root shell invalid

Look the links I send you from my last 2 responces. last one is:
http://www.adminschoice.com/docs/solaris_error_messages_o_s.htm#errno197
You must boot from CD and then mount the partition where the /etc/passwd is, and after that with editor ed or vi make the changes of the shell in /etc/passwd.
Regards,
Borislav
Vassilios
Frequent Advisor

Re: Root shell invalid

Hi.

The website says to do the following:

"....
After the system comes up and gives you a
# prompt,

mount the device corresponding to the original / partition somewhere, such
as with a mount(1M) command similar to the one below. Then run an editor on the newly-mounted system password file (use ed(1) if
terminal support is lacking):

# mount /dev/dsk/c0t3d0s0 /mnt # ed /mnt/etc/passwd

So, how can i find out the filesystem to mount, doing a cat on /etc/vfstab only gives me 3 filesystems, and not one is of a physical system.

Cheers
Robert-Jan Goossens
Honored Contributor

Re: Root shell invalid

Yes from ok> prompt use boot -s

ok> boot -s

if your system is up, use vi to change the shell to /sbin/sh (default root shell for solaris 9)
Borislav Perkov
Respected Contributor

Re: Root shell invalid

You should know on which partition is the /etc.
You have to start it again in normal mode and see where is the root partition. aAfter that boot from CD and make the changes
Vassilios
Frequent Advisor

Re: Root shell invalid

Hi all:

So, Robert-Jan's remark was to boot into single user mode, and from there vi and change the /etc/passwd file back to
what it should be.

Surely, at the console prompt, it will still ask me for a password, and subsequently fail due to No shell?


Concerning Borislav's response:

OK, so in normal mode I do:

a) a vi /etc/fstab (find out what the root partition is)
b) mount the root partition using mount /dev/dsk/ /a
c) vi /a/etc/passwd

....

Is that correct? First of all , fstab doesnt exist... how else therefore can i find out the root partition?

Thanks,