[CentOS] Setting PS1 for ordinary users

m.roth at 5-cent.us m.roth at 5-cent.us
Wed Oct 10 16:23:52 EDT 2012


James B. Byrne wrote:
> On: Wed Oct 10 15:58:43 EDT 2012 Bowie Bailey Bowie_Bailey at BUC.com
> wrote:
>> It doesn't matter where sh is pointing.  What matters is the
>> shell configuration.
>>
>> I'm using bash here:
<snip>
>> So try 'echo $SHELL' instead of 'which sh' to see which shell
>> you are using.
>
> That seems to be the issue here.
>
> [root at vhost04 ~]# echo $SHELL
> /bin/bash
>
> sh-4.1$ echo $shell
>
> Examining the passwd file as suggested shows that root has :/bin/bash
> and ordinary users have /bin/sh. And yet, the difference in behaviour
> seems strange:
<snip>
> As far as I can see the two invocations call the same program.  And
> yet, replacing /bin/sh with /bin/bash in the ordinary user's passwd
> entry does indeed change the prompt to one identical to that used by
> root.  Does anyone here know why this happens?

This is *very* odd, that users are created using sh, which is supposed to
resemble the original Bourne shell. It has far fewer capabilities than any
of the later shells, and I have no idea why you'd want users screwing with
that. It's very much *not* used much any more....

I'd change all users in /etc/password to bash, unless they've explicitly
requested something else - (t)csh, or zed, whatever.

      mark
      mark



More information about the CentOS mailing list