set up a root password

Derek Broughton news at pointerstop.ca
Wed Aug 6 14:17:19 UTC 2008


Nils Kassube wrote:

> Derek Broughton wrote:
>> Gene Heskett wrote:
>> > OTOH, that shell with root priv's should somehow make itself marked
>> > as such by a border color change or something, as when popping around
>> > to the various terminal shells running, it would be too easy to hit
>> > the wrong but root shell and mess the whole thing up.
>>
>> Can you imagine a way to do this?  It's a good idea, but I don't know
>> if it could be done.
> 
> You could put something like this line
> 
> [ "$UID" = 0 ] && PS1='\[\033[01m\033[41m\033[37m\]\h: \w/ #\[\033[m\] '
> 
> in the files $HOME/.bashrc and /root/.bashrc right before this line:
> 
> export PS1 PS2 ignoreeof

I didn't actually have those in either my .bashrc or root's.
 
> It will give you a white prompt with red background independent of the way
> you get a root shell.

Very cool - I had worked out that I could do that (but not how) in
root's .bashrc, but it hadn't occurred to me that I could use it in my own,
and get that same effect if I use "sudo -s" (which I don't, but it's still
worth having).

Thanks, Nils.
-- 
derek





More information about the kubuntu-users mailing list