Colourful SSH prompt

So you don't think you're executing that command locally when you're logged in remotely.

To clearly see that you are logged in to a computer via SSH, you better have a clear prompt. This prevents mistakes.

For a nice SSH I do the following things:
  1. Make sure that .bashrc is executed after logging in via SSH (it is not by default). Then you at least have the path, etc. set correctly in your SSH window.
  2. Show with a clear color in the prompt that you are working remotely.

I do that by modifying the .bash_profile file (on the remote PC you log in to). For me, .bash_profile was empty.
if [ -f ~/.bashrc ]; then
. ~/.bashrc

PS1='\[\033[1;36m\]REMOTE! ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033 [00m\]\$ '

How to use

Place the script in a file and make it executable with:
chmod +x 
Run the script from inside a terminal window:


Put this script in crontab so that it runs automatically periodically:
crontab -e
View 40 more scripts