سؤال

I can now forward one port 8080 to the remote port 80 by ssh -L 8080:localhost:80 user@host.com, Is it possible to do multiple port forwarding with one ssh connection?

هل كانت مفيدة؟

المحلول 2

That is called dynamic port forwarding and if both the SSH server and SSH client support this, you configure your clients to use the SSH client as a SOCKS proxy and the SSH does the rest. In this case one "SSH connection" (in fact SSH connection carries multiple independent channels "inside") is used to connect to multiple destinations.

نصائح أخرى

Yes, use -L option for each port to be forwarded.

Example:

ssh -L 8080:localhost:80 -L 7070:localhost:70 user@host.com
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top