Koozali.org: home of the SME Server

[solved] Configuring cosmetics of the user bash prompt?

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
[solved] Configuring cosmetics of the user bash prompt?
« on: August 19, 2006, 09:57:28 PM »
I installed the dungog user remote access contrib to create a user to have access to my developer machine for building RPM's using SSH2 keys, all that went perfectly well, but now I am left with the following problem:

Can someone tell me how I can configure a users bash prompt to have the familiar look and feel that we are used to for the root user:
Code: [Select]
[root@homer ~]#

Which templates do I have to configure? Perhaps someone can tell me where to find the settings that are used for the root account.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Configuring cosmetics of the user bash prompt?
« Reply #1 on: August 19, 2006, 10:29:23 PM »
Quote from: "cactus"
Can someone tell me how I can configure a users bash prompt to have the familiar look and feel that we are used to for the root user:
Code: [Select]
[root@homer ~]#

Which templates do I have to configure? Perhaps someone can tell me where to find the settings that are used for the root account.


Using google and browsing through the /etc directory I found that if I manually modify the PS1 environmental variable for the user I can set the desired format at the command prompt:
Code: [Select]
export PS1="[\u@\h \W]\\$ "
The PS1 value seems to be set in the /etc/bashrc file, but unfortunately this file is not templated. Do I need to set a certain value somewhere in the configuration/accounts database of the SME server to force this setting perhaps?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
[solved] Configuring cosmetics of the user bash prompt?
« Reply #2 on: August 19, 2006, 11:06:43 PM »
Found the solution:

[list=1]
  • Log in as the user for which you want to modify the bash prompt
  • Make a .bash_profile file in the top of the users home directory
  • In this file put the following line:
    Code: [Select]
    export PS1="[\u@\h \W]\\$ "
  • Log out and log in again to see the result.[/list:o]

    For more options for setting the PS1 string have a look here: http://www.expertsrt.com/tutorials/Matt/CmdPrompt.html
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)