Port forwarding on ec2

less than 1 minute read

we want to get to prod1 but it’s only accessible through mid and we want to reach it from localhost


ssh -fN -L<LocalPort>:<prod1 ip/hostname>:<prod port> my-keypair.pem ec2-user@<mid ip>


ssh -fN -L<LocalPort>:<Where you want to get>:<port> my-keypair.pem ec2-user@<through where>

and eventually what we get is this: we want every request sent to localhost:1234 to go to through

ssh -fN -L1234: my-keypair.pem ec2-user@