Keeping track of which machines you’re SSHed into can be a pain, especially when you’re dealing with a large number of connections. At one point, I was connecting to 30+ machines every morning to monitor things like htop, mongostat, iostat and misc log files. Looking at 30 tabs in terminal named ubuntu@ip-10-95-85-205:~$ was not very helpful.
Below is a snippet of code I wrote at the end of my ~/.bashrc file which sets the command prefix to MachineName:~$ and attempts to set the title of the terminal tab to MachineName. Be sure to update the variable in the first line.
Hopefully this makes managing your connections a little bit easier. Enjoy!