I connect from machine A to machine B. In machine B, I'd like to print A's hostname in bash's command prompt.
I tried to get this using who -m and doing some cuting, put output differs between different unix'es.
I could not find any direct way to get this hostname.
I see two possibilites:
- Somehow passing it when connecting using
ssh(I don't think I will ever use something else to connect remotely) - Processing
who's output in multiple ways and hoping there aren't too much versions around
Possibility (1) is preferred, because I can send the hostname I've assigned to a host and not my carrier's one, but I couldn't find any way to archive this in man ssh_config.