Hi
I have a number of Ubuntu linux boxes that I ssh into, but sometimes I do it from iTerm2 on a mac, and sometimes from MobaXterm on windows.
From the Ubuntu box, is there something I can check for that will tell me that I'm coming from this or that OS or terminal program?
(The x/y problem here is that on my Linux boxes I have .zshrc code that will tell iTerm to use a particular profile for each box so I can easily tell them apart via different backgrounds, but I don't want that to run unless I'm ssh'ing in from iTerm2. Other ideas welcome.)
Does iTerm2 set some unique environment variable(s)? Sending that variable over connection and testing it in script would really narrow it down to "from iTerm2".
I have a number of Ubuntu linux boxes that I ssh into, but sometimes I do it from iTerm2 on a mac. ...
(The x/y problem here is that on my Linux boxes I have .zshrc code that will tell iTerm to use
I don't understand the problem. You want ssh client iTerm on your mac to look different depending on the OS of the server (when they're all Linux)?
As @keskiverto mentioned above, if want to build some intelligence into the server, I think SendEnv/AcceptEnv is the way to go.
in windows, you can name a console session (its title bar). I don't recall if unix can do this, but if it can, that may help too .. a script as part of the launch for the connection and its set.