Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why I can't set up an SSH tunnel? Bad local forwarding specification

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading