[CentOS] Setting PS1 for ordinary users

Thu Oct 11 06:44:28 UTC 2012
Tony Molloy <tony.molloy at ul.ie>

On Wednesday 10 October 2012 19:42:32 James B. Byrne wrote:
> CentOS-6
> When I login as root I see this prompt:
> [root at vhost04 ~]#
> When I login as a non-priviledged user I see this instead:
> sh-4.1$
> .bashrc and .bash_profile have identical contents in /root and
> /home/user.  What causes the difference?  Why?  How does one change
> the default so that all normal users get a [userid at hostname pwd]$
> prompt?
> I have loked in/etc/profile.d and /etc/bashrc and I cannot see what
> condition is triggering the different behaviour.

Create a file called  /etc/sysconfig/bash-prompt-xterm

with contents

echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD} [ `tty | sed -e 
"s:/dev/::"` ]\007"

watch for line wrap in e-mail

You can edit to suit your taste but the above gives

[molloyt at mufc ~]$ 

Then make sure your users have bash as their shell in the password file 
not sh.