- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Changing root's shell
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2000 04:24 AM
10-18-2000 04:24 AM
I'd prefer root have ksh, so I changed it to /usr/bin/ksh ... but I got errors, and I forget them now but in effect the complaint was that the login shell was not in /sbin.
Is it a requirement for the root login shell to be in /sbin? There is no ksh in there.
So - do I just copy ksh into /sbin from /usr/bin?
Also am wondering if ksh is not there already for some good reason.
Thanks,
Fred
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2000 04:30 AM
10-18-2000 04:30 AM
Solution/sbin/sh is the posix shell which has many features of the korn shell.
When taking /usr/bin/ksh as root shell this is risky because the /usr filesystem is not mounted ie. at single user mode.
Yes, you can copy /usr/bin/ksh to /sbin/ksh.
Have you trouble with command history ?
If so you have to set some varaibles in /etc/profile or $HOME/profile to make it work:
VISUAL=vi; export VISUAL
HISTFILE=$HOME/.sh_history; export HISTFILE
(/sbin/sh has also the feature of command history like ksh)
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2000 04:31 AM
10-18-2000 04:31 AM
Re: Changing root's shell
shells such as sh, ksh, and csh are all located under the /usr
directory which may not be mounted during earlier stages of the bootup
process. Changing the login shell of the root user to a value other
than /sbin/sh may result in a non-functional system.
================
The root account must use /sbin/sh, and may not be changed to any
of the shells in /bin. There are a couple of reasons for this,
all of which involve /usr not being mounted in single user mode.
When the system boots, one of the first things it must do is exec
a root shell at single user mode to run fsck and the various rc
scripts. At this time, the only file systems that are mounted are
/ and /stand. /bin is really a symbolic link to /usr/bin, which is
not mounted, so the shells there are not available until /usr has
been fsck'd and mounted, so we have no way to exec one of them. In
addition, the files under /usr/bin are dynamically linked, meaning
the shared libraries under /usr and the dynamic linker /usr/lib/dld.sl
must be available to load them (/lib is also a symbolic link to/usr/lib).
The executables in /sbin are statically linked and do not require the
shared libraries or the dynamic linker.
The shell under /sbin/sh is not the old Bourne shell - it is a statically
linked version of the posix shell, which should have most, if not all,of
the functionality of the Korn shell.
HOWEVER => I heard someone tried to subvert the system sucessfully using the following :.
He set up a link from /usr/bin/ksh to /sbin/sh that is in effect
during single user mode. Then when /usr gets mounted the real
/usr/bin/ksh covers the link. So the system boots to multiuser
with /sbin/sh and then root uses /usr/bin/ksh.
STRICTLY UNSUPPORTED though !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2000 05:06 AM
10-18-2000 05:06 AM
Re: Changing root's shell
Rather than do anything unusual as regards ksh, I set up the history per message above, so I'm satisfied for now.
If I find sh to have other shortcomings in the future I'll consider copying ksh to /sbin, but for now I'll leave it.
Thanks again,
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2000 05:41 AM
10-18-2000 05:41 AM
Re: Changing root's shell
'Tis very true!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2000 06:34 AM
10-18-2000 06:34 AM
Re: Changing root's shell
I will never do this.
Not just absolute unsuporported but the begining of problems.
Some process need /sbin/sh strictly to run.
There is a workaround, modify your /.profile
adding:
EDITOR=vi
export EDITOR
ksh
exit
This workaround let /sbin/sh for not looged in process, and let you to automoticaly start a ksh when you loggin as root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2000 11:52 AM
10-20-2000 11:52 AM
Re: Changing root's shell
The problem with shells other than /sbin/sh is that they are not available to root until after the /usr ist mounted if /usr is a separate volume, which it has absolutely no reason to be.
I usually allow for only 3 volumes in the vg00: boot, swap and root. Therefore I use /usr/bin/ksh for root and didn't have a single problem on account of that.
The real problem is: Why should anyone keep /usr separate from /? The standard way of partitioning into /, /stand, /usr, /opt, /tmp, /var and /home is inviting the trouble which it is supposed to eliminate, namely that in a unified volume a runaway process fills up the volume and cause a stall. By balkanizing the root volume group into so many separate volumes you are actually increasing the probability that any one of them will get full much sooner than if you kept them all coalesced in one huge volume.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2000 02:25 PM
10-20-2000 02:25 PM
Re: Changing root's shell
Dragan makes some very good points. I suppose, too, if there weren't differences in opinion or differences in "first assumptions" there wouldn't be so many languages and so many operating systems nor even "open" ones where individual contributions are welcomed; nee solicited.
A great article on "Why Root's Default Shell Should Be The Poxix Shell" can be found at the link below. Agree, or disagree as you wish, but based on some "first assumptions" it does point out some pitfalls if you fail to follow canon.
Regards!
http://education.hp.com/itrc/news/unix_art5.html
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2000 06:39 AM
10-22-2000 06:39 AM
Re: Changing root's shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2000 08:08 AM
10-22-2000 08:08 AM
Re: Changing root's shell
support for "exotic" loacles such as Swedish.
This POSIX shell is an almost true superset
of the Korn shell, so everything you expect
from ksh is there in /sbin/sh. The reason
for not allowing other shells is that
the system must be guaranteed to have a
shell which works without other partitions
being functional.
Bo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 01:39 AM
10-23-2000 01:39 AM
Re: Changing root's shell
Perhaps i had a bad experience ;-)
Yes, but in other UNIX O.S. and box did not boot.
The last line in James link is clear.