SSH Tunneling

ssh -L 8090:localhost:80 subdomain.domain.tld
ssh -o ProxyCommand='ssh bh nc %h 22' -L 8090:localhost:80 max.paulus@ip-10-0-77-62

ssh : create the ssh connection -o : I want to give an extra option ProxyCommand : Instead of connecting directly to the remote machine, I want to use a proxy machine first using this command -L : I want anything trying to access my local port to be forwarded to another port over this ssh connection 8090: the port on MY machine for which I want to forward traffic localhost:80 :after traveling over the ssh connection, the traffic will look like this on the remote machine ip-10-0-77-62 : the remote machine

ProxyCommand=‘ssh bh nc %h 22’

bh : the bastion host nc : immediately after connection to bastion host I want to run the netcat command %h : the remote machine specified outside of the proxy command 22 : the port with which I want to connect for netcat

Last updated

Was this helpful?