I have various systems to which i regularly ssh into . The problem is , at some point of time i forget the hostname into which i have ssh into. Its kinda tedious to keep checking hostname all the time. Is it possible to display the hostname in screen ( i use screen to ssh into remote machines ) .
For example
$screen
$ssh hostname.com
after i ssh , in my screen the current hostname is displayed.
put this in .bashrc
or .bash_profile
PROMPT_COMMAND='echo -ne "\033k$HOSTNAME\033\\"'
Does the "hostname" command work?
I suspect your solution will be terminal program specific. What is your terminal client? Take a look at http://kpumuk.info/mac-os-x/how-to-show-ssh-host-name-on-the-iterms-background/ .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With