- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- root 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
Discussions
Discussions
Forums
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
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
тАО11-22-2000 07:44 AM
тАО11-22-2000 07:44 AM
Per HP's document for 10.20, root's shell should be /sbin/sh. But our customized environment is all the super user use Korn Shell ( which means in /etc/passwd file, the shell for root is set to: /bin/ksh).
In order to do that, we have to boot the machine into single user mode, and do a: ln -s /sbin/sh /usr/bin/ksh. ( Because if you don't do this step, after you boot the machine, it will go to single user mode automatically and tells you " bad shell").
I know all these steps. But I don't understand why I am doing this. Could anybody explain to me how this thing works?
Thanks a lot in advance!
Sharon
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 08:01 AM
тАО11-22-2000 08:01 AM
Re: root shell
You have solved the problem yourself - as per HP documebntation root's shell should /sbin/sh which you stated.
Do not change the root shell and you will not have the problem.
Your customised environment should not be configured to require that the root shell be any other that /sbin/sh.
HTH
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 08:08 AM
тАО11-22-2000 08:08 AM
Re: root shell
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 08:11 AM
тАО11-22-2000 08:11 AM
Re: root shell
1) why root has to use /sbin/sh?
2) By the steps I mentioned , I am able to login as root using Korn Shell without problem. I want to know why by doing that symbolic link i can have what ever shell for root? ( Because i was just folowing some document from other people.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 08:19 AM
тАО11-22-2000 08:19 AM
Re: root shell
If you want root to use ksh on interactive shells, you can modify the /.profile to test if the shell is interactive and the fire up ksh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 08:26 AM
тАО11-22-2000 08:26 AM
Re: root shell
With your command ln -s /sbin/sh /usr/bin/ksh issued in single user mode, most probably with /usr unmounted (otherwise it would complain because /usr/bin/ksh already exists)
you create a symbolic link on the / filesystem.
That one will be hidden when you go multi-user and mount /usr.
The funny thing is that your newly created /usr/bin/ksh is totally equivalent to /sbin/sh as this is the file it points to.
As far as you're single user, it's just the same shell (posix).
Whe root logs in in multi-user state, he's got a korn shell.
The reason why root needs the /sbin/sh shell is that, as it as been said before, this one has been compiled with static libraries.
If it was compiled with dynamic libs instead, it won't find those libs in single-user state as the filesystems where those libraries reside isn't mounted yet.
Best regards
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 08:45 AM
тАО11-22-2000 08:45 AM
Re: root shell
I totally agree with Tom and Dan. I would suggest that you modify your ~/.profile so that the last line does an exec /usr/bin/ksh (if you must absolutely use the korn shell... mind you most of the features of ksh are supported by posix-sh)
#echo "exec /usr/bin/ksh" >> ~/.profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 08:53 AM
тАО11-22-2000 08:53 AM
Re: root shell
Does this mean when a system boots, it goes to single user mode first? And then change to multi-user mode?
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 09:06 AM
тАО11-22-2000 09:06 AM
SolutionWhen the system boots, it goes straight to the level specified in your /etc/inittab under initdefault. look for initdefault in this file and the number associated with it eg.
init:3:initdefault:
says that it should run at run level 3.
As it happens in order to reach run level 3, it has to execute scripts in order - these scripts are found in /sbin/init.d/rcX.d (where X is the run level)
and are typically a superset of the scripts in run level one.
To answer your question, theoretically, it does go through single user mode to get to the final run level.
there is a good document on your server in
/usr/share/doc called start_up.txt explaining the startup process - it is well worth a read.
Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2000 11:55 AM
тАО11-22-2000 11:55 AM
Re: root shell
Why not create a second account for UID 0, with the same home directory as 'root,' but with a different name and a different shell? I have a UID 0 account named 'rootb' which uses the Bourne-Again shell (bash). You could create a 'rootk' account--or whatever--and specify the Korn shell instead. You can use the two accounts interchangeably however you like, since they have the same UID and home directory. And you don't have to worry about screwing up the 'real' root account.
This is usually almost the very first thing I do when I get my hands on a new system. I also move root's home directory to /root (which is NOT on a mounted filesystem). Otherwise, after time, you get that unsightly buildup of dot-files and other garbage at the root of the filesystem--yuck!