I sshed to my bastion host which has public IP. Now I try to set up an SSH tunnel by using the bastion host and executing the command
ssh -L 4000:10.0.0.182 ec2-user@54.236.29.63
I got
Bad local forwarding specification '4000:10.0.0.182'
What does that mean and how can I fix it?
>Solution :
You are passing a wrong value to the -L option.
From the ssh(1) manual page:
-L [bind_address:]port:host:hostport
-L [bind_address:]port:remote_socket
-L local_socket:host:hostport
-L local_socket:remote_socket
Try using -L 4000:10.0.0.182:4000, this way whenever a connection is made to the local port 4000 (on your local station), the connection will be forwarded to 10.0.0.182:4000.