[SunHELP] Root Access Problem
Nicholas Dronen
sunhelp at sunhelp.org
Fri Feb 9 11:07:22 CST 2001
On Fri, Feb 09, 2001 at 10:08:04AM -0500, Krishna_Raj at forethought.com wrote:
> Hello everybody:
>
> When trying to change the default shell of root, I put in a incorrect
> location (/sbin/ksh instead of /bin/sh) in /etc/passwd file. Without realising,
> I logged out & now, I am trying to logon, it says 'No shell' or invalid shell. I
> haven't set up any passwd for root. I even tried to ftp change the passwd file
> but, I am not able to ftp as root as because ID does not have password.
>
> How do I fix this problem ? I do not have OS CD with me, I got is machine
> pre-installed with Solaris 7.
As the other fellow mentioned, you're not supposed to do this.
Root's default shell is statically linked, which means that
if someone blows away libc.so, you still have a chance of
recovering without an interruption of service (if you're
creative). You have a (better) chance of accomplishing
this if you also have the statically-linked utilities
package installed.
If you really need to use a different shell as root (and
who doesn't?), I suggest leaving the default shell as
/sbin/sh and *optionally* execing ksh from root's .profile.
It should be optional, as execing a file that doesn't exist
is an unhappy thing, as is execing a file that's corrupt.
So, say you need to login as root, because admin X messed
something up, and one of the things he messed up is ksh.
If you don't check whether ksh exists and then ask/prompt
the user whether they want to use ksh, you won't be able
to login. Downtime ensues.
Regards,
Nick Dronen
More information about the SunHELP
mailing list