SUMMARY: No shell for root

From: Spiliotis Iraklis (
Date: Wed Jul 19 1995 - 09:18:30 CDT

Hi everybody,

I got a lot of e-mails with suggestions and avdices. Thanks to all of 51
people (till now) that spend some of their time to send me a suggestion.

Since I didn't find a security hole, the solution is to boot the system
from a CD (i.e. boot cdrom -s), to mount the / file system from disk and
to change to mounted /etc/passwd file.
So we have decided to buy a CD with Solaris 2.4 and to plug a SCSI CDROM
in order to fix the problem.

Here is a summary list of the other received suggestions and some
mine comments explaining why I cannot apply them (just for your records):
S(uggestion): A lot of people suggested to boot in single user mode (i.e.
<stop><a>; boot -s) and edit the /etc/passwd file or link /sbin/sh to
C(omment): I actually had tried to boot with all different runlevels and
in single mode too, before sending the first mail to the list. The system
tries to execute the specified in /etc/passwd shell even in single user
mode. As some people told this is a feature of Solaris 2.x. Having
experience with HP administration this looks strange to me, it seems that
SunOS becomes more secure than HPux and OSF - in contrast to the past:)
S: Some people suggested to mount writeble the disk to another system and
edit the /etc/passwd file from there or to mount a disk from another
system to copy a shell and change the SUID bit of the shell.
C: I have to become root first in order to export my file system or to mount
a file system from another machine.
S: To rlogin or rsh or rexec from another system.
C: I have not any trusted system to the new machine.
S: To create a new root user in the NIS (YP) maps at another machine.
S: To boot from another Sun on the net.
C: Is a standalone machine and there is not other Sun at the University.
S: To physically connect the disk to an HP or DEC machine and to
fix the /etc/passwd file from there.
C: What about the disk format?
Two people told me that is preferable to create a new root user with csh
than changing the /sbin/sh of the original root user. The reason is that
/sbin/sh is statically linked which means that it does not requires the
shared libraries from the /usr in order to operate, while /bin/csh it
does. This may becomes critical when the shared lirary becomes corrupted
or the /usr is a mounted partition and the fsck fails.

Thanks everyone who sends a suggestion

The first message to the list is following:

> Hi there,
> I was trying to change the root's shell from sh to csh on a SPARCstation 4
> running Solaris 2.4. Since the command chsh does not exists, I decided to
> change the entry in the /etc/passwd file to /bin/csh.
> Unfortunately, I didn't observed that the original entry was /sbin/sh
> instead of /bin/sh and I got a /sbin/csh for root. But there is not a
> /sbin/csh file.
> As a result I cannot login as root. The system writes the message 'No
> shell' and logs me out.
> We have the Sun about 10 days and I spend these days 'learning' the
> machine and downloading s/w and I haven't setup any root privileged users.
> We haven't a CD or a tape with SunOS to boot from there.
> We have HP and DEC machines, but no other Sun to boot from the LAN.
> I tried to ftp a new passwd file as root but I cannot because I haven't a
> valid shell, I cannot su or sulogin because these processes try to run the
> /sbin/csh, I tried to boot with different runlevels, I tried to rsh a shell
> command but I haven't a .rhosts file..
> I phoned the sales company and told me to send back the machine, in order
> to fix the problem.
> Can I do anything here to fix the problem without send the machine back?
> Thanks in advance,
> Iraklis Spiliotis
> Automatic Control Systems Laboratory
> Department of Electrical & Computer Engineering
> Democritus University of Thrace
> Xanthi 67100

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:29 CDT