Before I can to connect to a particular remote machine I have to run a certain local command. So instead of ssh [email protected]
I have to do
local_command
ssh [email protected]
I would like to automate this so that I only have to do ssh remote.machine
.
I know that I can achieve this at the shell level by creating my own ssh
script that calls /usr/bin/ssh
, but can I do it using the ProxyCommand option of ssh_config
?
As far as I understand it, I need something like
Host remote.machine
ProxyCommand local_command; ssh [email protected]
in my ~/.ssh/config
file, but not exactly this of course because it's circular!