Não sei qual versão foi adicionada, mas acho que você deseja usar %n
em vez de %h
. Na página man do ssh_config (5):
LocalCommand
Specifies a command to execute on the local machine after successfully
connecting to the server. The command string extends to the end of the
line, and is executed with the user's shell. The following escape character
substitutions will be performed: ‘%d’ (local user's home directory), ‘%h’
(remote host name), ‘%l’ (local host name), ‘%n’ (host name as provided on
the command line), ‘%p’ (remote port), ‘%r’ (remote user name) or ‘%u’
(local user name).