Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invalid root shell !!!

Status
Not open for further replies.

tweeester

Programmer
Nov 15, 2001
4
YU
Hello,

Problem is following (SOlaris 2.8 on SunSparc Workstation)

- I logged in as a simple users
- su root
- change /etc/passwd, change root's shell from /sbin/sh to /sbin/bash
- I can't login now as a root (or su root) becouse /sbin/bash is invalid file path (message "no shell")

What can I do? My boss will kill me ...

Please help
Tweeester
 
I know that /sbin/bash is invalid shell, it supposed to be /usr/bin/bash but I misstyped it, now I cant change passwd file becouse only root has right to write to it

Does anyone know how to reboot machine into single-user mode ???
 
You will have to halt your system and go to the ok prompt.At
the ok prompt boot from the cdrom.
example:
ok> boot cdrom -sw

after booting up do a fsck on your disk partition.
example: fsck /dev/rdsk/c0t0d0s0
After fscking then mount your root partition to /mnt
example: mount /dev/dsk/c0t0d0s0 /mnt
Then cd to /mnt/etc
vi the passwd file and change the shell back .
halt and reboot normally.
 
In single user mode you should be able to get a shell regardless of what is entered into /etc/passwd.
 
I've made that mistake in a Sun class. Tuka is all over it. One thing to note is that you need to set your term to sun so in the c-shell setenv TERM sun <return> will suffice. Also I am not familiar with the w flag for booting. What does that do Tuka?
 
Sorry, I forgot to mention that I succeeded following tuka's advice, booting from CD, etc..., BTW, single-user mode was not accessible (when booting from HD) - it refused to eneter signle user mode (also: Invalid shell message) and end-up switching into run-level 3...

10x again tuka!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top