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

Time:01-23

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 [email protected]

I got

Bad local forwarding specification '4000:10.0.0.182'

What does that mean and how can I fix it?

CodePudding user response:

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.

  • Related