set up a root password

Nils Kassube kassube at gmx.net
Wed Aug 6 13:29:33 UTC 2008


Gene Heskett wrote:
> On Wednesday 06 August 2008, Nils Kassube wrote:
> >It will give you a white prompt with red background independent of the
> > way you get a root shell.
> >
> That looks as if it should work nicely.  One other question?  I'm in a
> root shell, and I want to build the latest amanda snapshot, so I "su
> amanada;cd" which puts me in ~/amanda where I build these.  Will it
                               ^^^^^^^^ I suppose you mean "/home/amanda".
> keep that background I have while I'm running as amanda, in this same
> shell?  It seems like it would, but ATM I haven't checked.

No, it will only use that colour prompt for root. But you could modify the 
colours to identify individual users. Use the command

PS1='\[\033[01m\033[41m\033[37m\]\h: \w/ #\[\033[m\] '

on a command line and modify the numbers 41 and 37 in that string to find 
out what colour combinations you like. Here is an excerpt from the 
file /etc/DIR_COLORS from an old SUSE distribution, that's where I found 
the colour numbers.

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white

Then put the command with the colour combination you like in the file 
~/.bashrc of the user in question before the line which makes the colour 
prompt for root.


Nils




More information about the kubuntu-users mailing list