/bin/sh is corrupt and hence root cannot login

/bin/sh is corrupt and hence root cannot login

Post by Jimm » Thu, 28 Nov 2002 17:31:35




> ...

> Doing a cat of /etc/passwd shows that it is pointing to /bin/sh, but
> when I try to fire it as a user, all I get is a Seg-Fault.

> I have tried su to, and it still fails.

Even if you do "su" with no arguments?  That should work because
you only change to the superuser shell with "su -"

If you've got problems with plain old "su" then there's something
more to this scenario...

-Jimmo

 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Dave Uhrin » Thu, 28 Nov 2002 23:45:20



> Something happened during the last reboot, because logging as root now
> return "no shell".

> Doing a cat of /etc/passwd shows that it is pointing to /bin/sh, but
> when I try to fire it as a user, all I get is a Seg-Fault.

> I have tried su to, and it still fails.  I have tried using the
> SMC-2.0 to try and change the role and permissions of a generic user,
> but still I cannot get into root.

Root's shell is /sbin/sh, not /bin/sh.  Boot from Software CD 1 and edit
/etc/passwd.

 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Mark R.Bannist » Fri, 29 Nov 2002 00:32:20




> > ...

> > Doing a cat of /etc/passwd shows that it is pointing to /bin/sh, but
> > when I try to fire it as a user, all I get is a Seg-Fault.

> > I have tried su to, and it still fails.

> Even if you do "su" with no arguments?  That should work because
> you only change to the superuser shell with "su -"

> If you've got problems with plain old "su" then there's something
> more to this scenario...

> -Jimmo

Is the root shell not set to /sbin/sh ?  Try different shells out of
interest.  If you're getting problems with /bin/sh, /bin/ksh and
/bin/csh but not /sbin/sh then you might have a corrupt library
somewhere in /usr/lib.

Mark.

 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Dave Uhrin » Fri, 29 Nov 2002 00:53:28





>> Root's shell is /sbin/sh, not /bin/sh.  Boot from Software CD 1 and
> edit
>> /etc/passwd.

> # which sh
> /usr/bin/sh

> However sh does exist in both directories though.  All of this
> occurred not long after running the SMC3 installer.

> It did not occur straight away, but after some other operations root
> was no longer able to log in due to the Seg-Fault on sh

/sbin/sh is statically linked, /usr/bin/sh is dynamically linked.  You
may at some time come to appreciate the importance of this.
 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Geezer From The Freeze » Fri, 29 Nov 2002 01:04:37



> /sbin/sh is statically linked, /usr/bin/sh is dynamically linked.  You
> may at some time come to appreciate the importance of this.

Indeed - listen to Dave!!

or regret it later!

 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Rich Tee » Fri, 29 Nov 2002 02:31:50



> I ended up replacing the /bin/sh with that from another S8 system that I
> have (same architecture) and it seems to be working fine now.

I take it you mane "/sbin/sh", not "/bin/sh"?  Root's shell
should be (and is by default) the former.

--
Rich Teer

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-online.net

 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Erik Max Franci » Fri, 29 Nov 2002 03:57:04





> > Root's shell is /sbin/sh, not /bin/sh.  Boot from Software CD 1 and
> > edit /etc/passwd.

> # which sh
> /usr/bin/sh

That just tells you where the first sh is in your path, not what's root
shell is.

--

 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Don't want you to leave / And I don't want to leave you
\__/ Chante Moore
    CatCam / http://www.catcam.com/
 What do your pets do all day while you're at work?  Find out.

 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Thomas Deh » Fri, 29 Nov 2002 04:53:41





> > Root's shell is /sbin/sh, not /bin/sh.  Boot from Software
> > CD 1 and edit /etc/passwd.

> # which sh
> /usr/bin/sh

> However sh does exist in both directories though.

You missed the difference between /usr/bin and /bin, didn't you?
See Dave's posting why using /usr/bin/sh as a login
shell for root might be a bad idea.

Thomas

 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Stephen Harr » Fri, 29 Nov 2002 05:48:27





>> /sbin/sh is statically linked, /usr/bin/sh is dynamically linked.  You
>> may at some time come to appreciate the importance of this.

> That being the case, why would a default install point to /bin/sh?

It doens't.  You've missread (or ignored) a lot of posts that point
this out.  The default shell for root is /sbin/sh

  pizza% uname -a
  SunOS pizza 5.8 Generic_108528-11 sun4u sparc SUNW,Ultra-5_10
  pizza% grep root /etc/passwd
  root:x:0:1:Super-User:/:/sbin/sh

Quote:> The system is still in its rather vanilla state atm.

If your root shell is /bin/sh then it's been broken somewhere...

--
                                 Stephen Harris

      The truth is the truth, and opinion just opinion.  But what is what?
       My employer pays to ignore my opinions; you get to do it for free.

 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Dave Uhrin » Fri, 29 Nov 2002 08:28:06





>> It doens't.  You've missread (or ignored) a lot of posts that point
>> this out.  The default shell for root is /sbin/sh

> No I did read, but what I am seeing here on this system is not
> reflecting what I am seeing here in the ng.

> Something must have happened between the final reboot and the
> installation of SMC3.

If you did not change root's shell then someone else did.
 
 
 

/bin/sh is corrupt and hence root cannot login

Post by Davorin Vlahovi » Fri, 29 Nov 2002 17:27:12




> I ended up replacing the /bin/sh with that from another S8 system that I
> have (same architecture) and it seems to be working fine now.

Do you have any other shell?

try

        su root -c "another shell"

--
Quid agis, caput assulae?

 
 
 

1. "Cannot execute /bin/*sh: Permission denied" prevents login

Are you trying to log in as root???
if you are, and no dice.  pull the plug, boot from floppy, and start
checking your etc/ dir for anything fishy.

 SS> -!-
 SS>  ! Origin: Psychotronic BBS = Durham NC = 919-286-4542 = PCP:NCRTP
 SS> (1:3641/1)

... Sincerely , Derek H Bischoff I

2. No MTTR support for Linux on Athlon

3. Video Capture Board & Camera

4. root's shell, /sbin/sh, /bin/sh and /usr/ksh

5. removing SCSI hard disk

6. executing /bin/sh script in a /bin/csh login

7. set proxy via dhcp ?

8. inetd.conf : 9705 stream tcp nowait root /bin/sh sh -i

9. executing /bin/sh script in a /bin/csh login #2

10. #!/bin/sh #!/usr/bin/sh can I do both for 2 diff machines

11. more secure?: "#!/bin/sh -" or "#!/bin/sh"

12. INIT:Cannot Execute "/bin/sh"