2007-03-13-ssh-tunneling-with-putty-linux.md 2.54 KB
Newer Older
Danesh Manoharan's avatar
Danesh Manoharan committed
1
2
---
title: SSH Tunneling with Putty | Linux
3
author: Danesh Manoharan
Danesh Manoharan's avatar
Danesh Manoharan committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
date: 2007-03-13T06:58:56+00:00
pvc_views:
  - 48446
dsq_thread_id:
  - 889737832

---
SSH tunneling or also known as port forwarding is a way of forwarding normally insecure TCP traffic through SSH. Common ports for example POP3,SMTP,HTTP and FTP can be easily tunneled using SSH.

SSH tunneling is also sometimes used to bypass firewalls where certain ports are blocked.

The figure below represents the network setup at my workplace where the only port available to use is SSH port 22. By implementing portwarding over ssh I am able to port forward Oracle traffic over port 22 to my Oracle DB database running on my private VM with host only networking enabled.

![SSH Tunneling][1] 

19
In this post I will show you how to apply SSH tunneling using the windows SSH client Putty. I'll cover the Linux implementation in my future post.
Danesh Manoharan's avatar
Danesh Manoharan committed
20
21
22
23
24
25
26

<!--more-->

You will need Putty to get started. Putty is a popular free win32 based SSH/Telnet client. Obtain the latest version 0.59 at the homepage.

[Putty Home][2] | [Putty Download][3]

27
Run Putty, key in the address for your Linux box. In this example "10.99.34.6" "Pandora" is the Linux box hosting VM and on the VM "192.168.66.100" the is an Oracle database running on RHEL 3. The VM is setup with host only networking so it has no access beyond the host machine "Pandora".
Danesh Manoharan's avatar
Danesh Manoharan committed
28
29
30

[![putty1.png][4]][5]

31
Look for the SSH tree entry in the menu to the left. Expand it and go to "Tunnels".
Danesh Manoharan's avatar
Danesh Manoharan committed
32
33
34
35
36
37
38
39

[![putty2.png][6]][7]

Fill the the required information and click add.

**Source Port:** 1521  
**Destination:** 192.168.66.100:1521

40
41
42
"Source port" is the port Putty will listen on for incoming connections.  
"Destination" is the destination port we are trying to access. In this example the Oracle listener is listening on port 1521 for incoming traffic so we use that.  
"1521" is the standard Oracle listener port.
Danesh Manoharan's avatar
Danesh Manoharan committed
43
44
45
46
47

[![putty3.png][8]][9]

Remember to save the session in the session page.

48
Open Putty and login to the Linux box "Pandora" and port forwarding should be up.
Danesh Manoharan's avatar
Danesh Manoharan committed
49

50
That's it, have fun.
Danesh Manoharan's avatar
Danesh Manoharan committed
51
52
53
54
55
56
57
58
59
60

 [1]: /wp-content/uploads/2007/03/ssh-tunnelling.jpg "SSH Tunneling"
 [2]: http://www.chiark.greenend.org.uk/~sgtatham/putty/
 [3]: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
 [4]: /wp-content/uploads/2007/03/putty1.png
 [5]: /wp-content/uploads/2007/03/putty1.png "putty1.png"
 [6]: /wp-content/uploads/2007/03/putty2.png
 [7]: /wp-content/uploads/2007/03/putty2.png "putty2.png"
 [8]: /wp-content/uploads/2007/03/putty3.png
 [9]: /wp-content/uploads/2007/03/putty3.png "putty3.png"