You are not logged in.
Pages: 1
When you run "su -" or "sudo -i" where does it get the settings for bash PS1?
And how do I change it?
Last edited by anonymous_user (2010-02-07 02:46:10)
Offline
You can change it in /root/.bashrc
I also was wrestling with this the other day because the .bashrc that doesn't seem to help when you login to a tty shell. for that I had to add something like this to /etc/profile:
if [ "`whoami`" = "root" ]; then
lpath="/root/bin"
PS1="\[\e[31;40m\]\u:\w# "
else
lpath="/home/`whoami`/bin"
PS1="\[\e[32;1m\]\u:\w$\[\e[0m\] "
fi
export PS1
PATH="$lpath:/bin:/usr/bin:/sbin:/usr/sbin"
export PATH
(Yes, I left the red color on root open because I like all of root's text output to be in red.)
Offline
Also with sudo I think you need to add an env_reset to /etc/sudoers
Defaults env_reset,rootpw
Offline
Pages: 1