Posted by: kezhong | August 31, 2011

Using SSH Tunnelling(Port Forwarding)

SSH tunnelling (also known as “Port Frowarding”) is very useful at work environment. For example, I want to configure and manage the switches that can be managed by the web-based management application in the datacenter, but I work at my office. Or I want to copy some files to the server in the datacenter from my office. Through using ssh tunnelling, I don’t need to go to datacenter to configure switches on the site, and don’t need to copy files to gateway and then copy from gateway to server.

ssh -L <localport>remoteip<remoteport> <username>@<bridgeip>

Case 1
From the above picture, there is a management server connectting to the management port of switches in datacenter. For the privacy, I suppose that the IP of the management server is, the IP of the switch1 is At my fedora desktop, I open a terminal and type

$ ssh -L 8080: kezhong@ cat –

and then open my browser, go to

Case 2
From the above picture, I want to copy files from my pc to server1. Suppose that the IP of the gateway is, and the IP of the server1 is Open a terminal and type

$ ssh -L 8082: kezhong@ cat –

Open another terminal, type
$ scp -P8082 ubuntu-10.10-server-amd64.iso kezhong@localhost:/tmp/ubt.iso




  1. Hey there would you mind sharing which blog platform you’re working with? I’m planning to start my own blog in the near future but
    I’m having a hard time making a decision between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I’m
    looking for something unique. P.S My apologies for getting off-topic but I had to ask!

  2. Excellent site you have here but I was curious about if you knew of
    any user discussion forums that cover the same topics
    discussed in this article? I’d really like to be a part of
    group where I can get responses from other experienced people that share the same interest.
    If you have any suggestions, please let me know.

    Thanks a lot!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: