Customize root prompt

Woodchuck djv at bedford.net
Thu Mar 29 20:19:38 PDT 2007


On Thu, 29 Mar 2007, Nick ! wrote:

> On 3/29/07, Alfredo Perez <alfredoj69 at rogers.com> wrote:
> > Hello there
> >
> > I am been trying to customize my own root promt
> > but no suuccess.
> >
> > I made a new .kshrc in the root's home.
> > I have updated the root .profile to include "export ENV=$HOME/.kshrc"
> > I have changed the file /etc/ksh.kshrc
> >
> > None of the above have given me good results.
> >
> > Can anybody point me to the right direction?
> 
> What did you put in the kshrc files?

This, of course, is the critical question.

> Are you sure they are being run when you think they are being run? Try
> putting echo statements in them.

This is highly dangerous.  These echos will echo, possibly, all
over the place.  .kshrc gets called whenever root spawns a shell.
Sometimes this echoing can be to the argument line of programs.
There's an unwritten assumption that root's .kshrc be silent.

An echo or two is ok for testing, but don't leave them around.

> Can the root prompt even be customized? I can imagine it might be
> immutable for security-against-social-engineering reasons.

Yes, it can:

[root at pequod CCDD 1:114]# echo $PS1
[\u@\h \W \j:\!]\$
[root at pequod CCDD 1:115]# 

OP should check with vipw that root's default shell is ksh.

Dave
-- 
     Resistance is futile.  You've already been assimilated.


More information about the Openbsd-newbies mailing list