Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Root's Default Shell

Status
Not open for further replies.

stovie

Technical User
Apr 7, 2003
32
US
I am new to solaris and need help with setting root's default shell. I would like to set root's default shell to the korn shell. Here is the senario, when I login to my solaris machine, root's home directory is actually "/". The only configuration files I see under "/" are .dtprofile. Do I have to create .kshrc and .profile for root? I primarily use linux where this is done for you, so I am a little confused. Any help will be greatly appreciated.
 
The default profile is under /etc. You can create a .profile under / if you would like, Solaris does not do this for you as root.
 
The default for root on Solaris is sh, while the default for root on AIX is ksh.

Hooray again for AIX!!!
 
The easiest way (also dangerous) of changing your default shell is to modify the /etc/passwd file. Change the /sbin/sh to /bin/ksh in the root entry. I say this is dangerous because if something happens to the root file system and /bin is effected, root will not have a default shell. Root willl not be able to login. Of course if something happens to the root file system, most likely you are booting from CD anyways. Your choice...

Another way is to set SHELL in .profile to ksh. Export SHELL and then execute the ksh command.

One more way is when you login into root and you want to use the Korn Shell, is to execute the ksh command from from a terminal window.
 
Actually, on Solaris systems /bin is a symlink to /usr/bin, so not changing the default shell is more of a protection against your /usr filesystem going bad.
 
Thank you all for the information. I have changed root's home directory to "/root" and the default shell to "/bin/ksh" in /etc/passwd. This seems to be more logical to me.
 
/sbin/sh is a statically linked executable, if you replace root's login shell I suggest to replace it with another statically linked one, if you have more than one Filesystem necessary for booting (eg: "/", "/var", "/usr")

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top