Ssh port forwarding

From Tran Minh Anh's website

Revision as of 21:19, 1 April 2011 by Mat (Talk | contribs)
Jump to: navigation, search

From comp1 to connect to comp3:port3 behind a ssh server comp2:port2 (port2=22):


1. Create a ssh tunnel:

ssh -L port1:comp3:port3 username2@comp2


2. While the ssh tunnel exists, login to comp3:port3 by using the forwarding port:

ssh username3@localhost:port1

Personal tools