Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple LocalForward in ssh_config

Tags:

ssh

config

How do I do multiple port forwarding in a .ssh/config file? On the command line, I can do:

    ssh 10.0.0.10 -L 8080:127.0.0.1:8080 -L 8443:127.0.0.1:443

but when I do:

    LocalForward 8080 127.0.0.1:8080
    LocalForward 8443 127.0.0.1:443

in .ssh/config, it doesn't work.

like image 428
Nova Avatar asked Jun 18 '14 07:06

Nova


People also ask

Can ssh listen on multiple ports?

SSH is by default configured to listen to port 22 and only on port 22. You can configure your SSH server to run on other ports, and the same method allows you to configure your SSH server to run and listen on multiple ports.

What is SSH dynamic port forwarding?

Dynamic port forwarding allows you to create a socket on the local (ssh client) machine, which acts as a SOCKS proxy server. When a client connects to this port, the connection is forwarded to the remote (ssh server) machine, which is then forwarded to a dynamic port on the destination machine.


1 Answers

The ssh_config man page says:

Multiple forwardings may be specified, and additional forwardings can be given on the command line. Only the superuser can forward privileged ports.

Perhaps the problem is with the permissions, are you using the same user for both commands?

like image 111
florzanetta Avatar answered Oct 22 '22 06:10

florzanetta