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 shell 2

Status
Not open for further replies.

gkout

Technical User
Mar 10, 2003
43
GR
I recently had a conversation with a colleague about changin root shell. He argued that it is a fundamental knowledge of unix that the root shell should not be changed, due to script compatibilty, libraries etc. We use solaris 9 as a server. I have done several installations in the past and always used korn shell, with no problems. I alwasy compile the software I install and ksh suits me for all the conveniences it provides. I consider ksh the best shell for root and I don't know if this has security implications.
I would like ur opinion on this.
Thnx,
George
 
Hi gkout,

I just couldn't leave this thread like I did. I have done some minimal testing on the following, which appears to work. Please try the following in /.profile (with root's default shell as /sbin/sh in /etc/passwd):

if [ -x /bin/ksh ]
then
ENV=/.kshrc
SHELL=/bin/ksh
export ENV SHELL
exec /bin/ksh
else
echo "Shell /bin/ksh was not found, so using $SHELL"
fi

Here are a few useful lines you might like to put into /.kshrc to get the "Arrow keys" to work for command recall, etc.

set -o emacs
alias __A=`echo "\020"` # UP arrow = ^P
alias __B=`echo "\016"` # DOWN arrow = ^N
alias __C=`echo "\006"` # RIGHT arrow = ^F
alias __D=`echo "\002"` # LEFT arrow = ^B

Also I found this link which gives a bit more explanation to the issues of changing root's default shell.

I hope this now helps.

Mike
 
Hi Mike, the new "improved" version seems to do the job, with one drawback.Have you tried <Ctrl+C>. Check it and you see that it just echoes "^C" and does not break the line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top