1

I have an alias command to connect to a computer using ssh.

Here is an example of my alias command:

alias yusuf-mongo-191='ssh yusuf@xx.xx.xx.xxx'

I want to customize the terminal of this remote machine to use a colored label, so I can easily determine which terminal it is. It doesn't matter where the label is. I just want to see the label and have a special color for the remote machine.

1 Answers1

2

You're looking at this the wrong way around: you need to make the change on the remote server, not on your local machine. Simply set your PS1 prompt to be a different color on the remote machine. Open your ~/.bashrc file on the remote, and change the PS1 variable so that it is different on that machine.

That way, you will always know what machine you are on. See here for details on how to configure your PS1 prompt:

Changing colors for user, host, directory information in terminal command prompt

terdon
  • 100,812