I've determined an answer to my question, but it's a bit of a pain.
First, I changed the entry in my local ~/.ssh/config file so that it looks like this:
Host pod
User root
SetEnv UNISONLOCALHOSTNAME=pod
Hostname 184.26.5.182
Port 10666
That's very easy, of course. But this won't work, however, unless sshd is configured in the container to allow the incoming ssh client to perform this SetEnv command. sshd is not configured to allow this by default. Consequently, I'll have to write a script that I can invoke on the container every time I spin it up, which does the following before I run unison on my desktop computer:
- Add the line
AcceptEnv UNISONLOCALHOSTNAMEonto the end of the container's/etc/ssh/sshd_config. - Tell the container's sshd to reload its config file by doing
kill -HUP `cat /var/run/sshd.pid`
ALTERNATIVELY:
And a bit more easily, I can just have a script modify /root/.bashrc in the container to have
export UNISONLOCALHOSTNAME=pod
placed at the TOPtop of /root/.bashrc. (It wasn't working when I placed it at the bottom of the .bashrc because it turns out that there is code in the .bashrc that exits early if the shell is not interactive.)
Unfortunately, I can't just edit the .bashrc once and be done with it since the root filesystem is reinitialized every time the container is started up. So this rewriting of /root/.bashrc has to either be done by a script that I either keep on the persistent filesystem that the cloud service provides. Or I can do the editing of the container's .bashrc via a local script on my desktop that uses ssh and scp to make the change.