I have a wp-cli.yml
file that defines an alias for a remote host:
@origin:
ssh: myserver.example.com
path: /path/to/htdocs
This would normally allow me to use wp @origin command
to run remote commands on the other host. In one case, however, the remote host is only visible through an SSH proxy, so my system has an SSH config entry in ~/.ssh/config
:
Host myserver.example.com
ProxyCommand ssh -q -W %h:22 proxyserver.example.com
ForwardAgent yes
This instructs it to first connect to the proxy server, then connect from there to destination server. I can log into that box in a single step simply by typing:
$ ssh myserver.example.com
However, when I attempt the same with WP-CLI it doesn't work:
$ wp @origin db export --add-drop-table -
Error: Cannot connect over SSH using provided configuration.
I conclude that WP-CLI either doesn't look at my SSH config or doesn't understand the ProxyCommand
directive there.
Is there anything I can add to either the wp-cli.yml
config or the wp
command to make it use a proxy the same way SSH does?
myserver.example.com
in my example does not resolve to an actual IP address. It's only visible through the proxy. The alias name@origin
is limited to wp-cli, and nothing to do with its domain name.myserver
, and put the same into~/.ssh/config
, it doesn't help.