MikiBelavista
MikiBelavista

Reputation: 2758

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

I got

Bad local forwarding specification '4000:10.0.0.182'

What does that mean and how can I fix it?

Upvotes: 0

Views: 4187

Answers (1)

Regalis
Regalis

Reputation: 71

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.

Upvotes: 1

Related Questions