You have to define the PS1 variable on the client system and make sure the definition is sourced when you
It's possible that it is already defined in
.bashrc on the remote system and so you just need to source
.bashrc by starting an interactive shell (replace
remote-sys with your remote system's name obviously)
ssh remote-sys -t bash -i
If that doesn't work, because
.bashrc doesn't exist on the remote system, or doesn't have PS1 defined, and you want to use the same settings on the remote system as your local system, then copy over your own
scp ~/.bashrc remote-sys:.bashrc
Or you can make a file purely to set the prompt the way you want it on the remote system... for example
enter the text (this sets user@host as the prompt)
export PS1="\u@\h "
or if you want it to look like the Ubuntu prompt
export PS1="\u@h:\w$ "
or customise however you like. Save the file and exit, then
scp it to the remote system
scp .set-prompt remote-sys:.set-prompt
ssh to the machine you will have to source the file explicitly and tell bash to make the shell interactive:
ssh remote-sys -t "bash --rcfile ~/.set-prompt -i"
If you do
sudo -i to change to root on the remote system, the prompt will change again as root's
.bashrc will be sourced.