My setup looks like this:
+--------+ +----------+ +-----------+
| Laptop | <---> | Middle | <--> | Server |
+--------+ +----------+ +-----------+
And the server is running a web server on TCP:127.0.0.1:8081. All the machines are running SSH and I have credentials to everything.
Before there was the box in the middle, I used to have my SSH config that read:
Host server
Hostname server.internal.tld
User ubuntu
IdentityFile ~/.ssh/some_key.pem
Port 20022
LocalForward 8081 localhost:8081
ServerAliveInterval 60
KeepAlive yes
ServerAliveCountMax 1
This let me hit the page in my browser by browsing to localhost:8081
.
Is there a line that I can add to my SSH config to get the same result now that there's a machine in the middle that I can proxy SSH through? Is this somehow what ProxyCommand
is used for? Will the LocalForward
line still work with ProxyCommand
?