1833018 Members
1968 Online
110048 Solutions
New Discussion

sh

 
SOLVED
Go to solution
j773303
Super Advisor

sh

What's the different between /usr/bin/sh and /sbin/sh ? Could it be possible to change t
the root shell to /usr/bin/sh since I view the /etc/passwd root belong to /sbin/sh ?
Hero
5 REPLIES 5
Massimo Bianchi
Honored Contributor

Re: sh

root just have /sbin/sh because is the olny shell avaiable at boot with no lvol mounted.

DO NOT CHANGE IT !!!!!

Massimo
Michael Tully
Honored Contributor
Solution

Re: sh


Never change the /sbin/sh entry in /etc/passwd as your system will lose the ability to boot. The main reason is that /usr does not boot in single user mode. You can see the differences with the 'chatr' command.

This old posting explains more than I can type.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2efaa14d9abcd4118fef0090279cd0f9,00.html
Anyone for a Mutiny ?
twang
Honored Contributor

Re: sh

Don't change root's default shell, it causes serious problem!!
Robert-Jan Goossens
Honored Contributor

Re: sh

Hi,

Quote Bill Hassel

subject: incorrectly edited the default shell for root user and now system has halted!

As you have seen, changing root's shell is a very bad idea. bash (and ksh and csh, etc) use shared libraries that are located on /usr. However, in single user mode there are no mounted filesystems except / and /stand. Leave root as /sbin/sh (which like all POSIX shells is quite compatible with bash). It's important to never login as root unless you are doing some specific system administration.

end quote

Regards,

Robert-Jan.
vasundhara
Frequent Advisor

Re: sh

Hi,

As the others said, removing it is really dangerous. And if by any chance your system hangs/ disks are not mounted, you can use /sbin commands to make system recovery to some extent. I will give you one example.

Someone has renamed libdld.sl After this, no single command was working as this was the very basic library. not even ls and mv. Then rebooting the system in single user mode and using /sbin/mv for moving libdls.sl to original name made the system up. So, the contents of /sbin are very important and do not play with /sbin commands.

Regards
VJ.