- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: root shell - /sbin/sh
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
02-12-2003 06:00 PM
02-12-2003 06:00 PM
root shell - /sbin/sh
I know that on hpux11.0 or 11x ,default root shell is posix (/sbin/sh) and must use the shell on hp box.
but, I don't know why the shell strongly recommended for Administrator(root)on hpux and if, i will use any shell (ksh,Csh..) for root dafault shell, what will happen to?
i hope to recived some stuff from specailist and power users.
Have a nice day~~^^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 06:10 PM
02-12-2003 06:10 PM
Re: root shell - /sbin/sh
Don't change the default shell for root unless you really want to break your system. The shell for root is configured so that it doesn't require any library files in /usr, which means that it will run from single user mode without any other filesystems mounted. You can search on the forum for other posts about changing root's shell and you'll read some horror stories.
If you really want to run another shell, I guess you could login as root and then exec the new shell, but I wouldn't recommend it.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 06:16 PM
02-12-2003 06:16 PM
Re: root shell - /sbin/sh
I found a couple of other posts that discuss why the default shell for root is /sbin/sh and why you shouldn't change it:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1774107d277ad611abdb0090277a778c,00.html
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2efaa14d9abcd4118fef0090279cd0f9,00.html
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 06:19 PM
02-12-2003 06:19 PM
Re: root shell - /sbin/sh
Part of the reason it uses /sbin/sh is that the real shells which live under /usr/bin cannot be used because /usr is mounted when the system boots.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 06:37 PM
02-12-2003 06:37 PM
Re: root shell - /sbin/sh
Will it have any problems?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 06:43 PM
02-12-2003 06:43 PM
Re: root shell - /sbin/sh
NOPE - will NOT work.
The sh under /sbin in statically linked.
Needs to be this way so it will work w/o /usr being mounted.
Shells under /usr/bin are dynamically linked & need /usr to run.
If you want another shell, invoke it after you login.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 06:45 PM
02-12-2003 06:45 PM
Re: root shell - /sbin/sh
Try this:
file /usr/bin/sh (or ksh or csh)
file /sbin/sh
You will see one teeny-weeny little difference - "dynamically linked". This means that unlike /sbin/sh (which is statically linked) the others require libraries BUT /usr ain't mounted in single-user so you have no shell and essentially you are dead.
Many people operate under the mistaken assumption that /sbin/sh is either a crippled version of the POSIX shell or is the Bourne shell. It is, in fact, a fully functional POSIX shell. The reason /usr/bin/sh is used by every other user is that dynaically linked version can share text (code) and reduce total memory use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 06:52 PM
02-12-2003 06:52 PM
Re: root shell - /sbin/sh
As John P. mentioned, you can start up a new shell after you log in (he doesn't recommend this, and neither do I).
Another option is to load sudo onto your system and use your own login for sys admin tasks - and not using root except for occasional tasks. That way, you can customize your login (shell, PS1, etc.) however much you desire, without possibly destroying the most important account on the system. You'll just have to get used to running some tasks with a "sudo" in front of it. It's also nice for emergencies - re-enabling the root account, changing root's password if it's lost, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 11:25 PM
02-12-2003 11:25 PM
Re: root shell - /sbin/sh
Hi,
In HP default shell is the POSIX,
if you change to any shell(csh/ksh) while booting machine goes into single user mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 11:52 PM
02-12-2003 11:52 PM
Re: root shell - /sbin/sh
you can see the differences in the binary with command "chatr"
# chatr /sbin/sh
/sbin/sh:
shared executable
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
data page size: D (default)
instruction page size: D (default)
# chatr /usr/bin/sh
/usr/bin/sh:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
data page size: D (default)
instruction page size: D (default)
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2003 01:32 AM
02-13-2003 01:32 AM
Re: root shell - /sbin/sh
a way to work around this is create other users with uid 0 and assign them any shell you like.
Jochen