If the title sounds confusing, it is, and I am highly confused. Here's the situation:
- I have a prod server
prod1that's firewalled incoming/outgoing traffic from/to all external Internet - Additionally, the only way I can SSH to this server is by first SSHing to an internal bastion
bastion.foo.com, then ssh with sshconfig e.g.ProxyCommand ssh -W %h:%p bastion.foo.com.
On prod1 I want to be able hit an API endpoint e.g. curl -I https://api.com (which uses port 443 as it's https) by somehow tunneling through my ssh connection to that server (only when I'm connected of course). After reading some blog posts, I thought RemoteForward was the answer:
Host prod1
HostName ...
User ...
IdentityFile ...
RemoteForward 443 api.com:443
ProxyCommand ssh -W %h:%p bastion.foo.com
But when I ssh prod1 the first thing the server says is:
Warning: remote port forwarding failed for listen port 443
How do I do what I'm trying to do? Am I on the right path?