SSH Port Forwarding

ssh -L 8888:www.linuxhorizon.ro:80 user@computer -N

   +----------+<--port 22-->+----------+<--port 80-->o-----------+
   |SSH Client|-------------|ssh_server|-------------|   host    |
   +----------+             +----------+             o-----------+
  localhost:8888              computer      www.linuxhorizon.ro:80

other example:
ssh -R 28:10.10.10.8:25 -R 29:10.10.10.1:25 root@server.ro -N

source1 source2

To enable GatewayPorts:

/etc/sshd_config:
GatewayPorts yes

source

 

Author: WladyX on 27 August, 2010
Category: General, Scripts, Ssh

Leave a Reply

Last articles