Artifact
778ecceca53d8d055e15487a0555ff50258d2b6f:
Wiki page
[port-forwarding] by
sandro
2018-07-15 13:40:22.
0000: 44 20 32 30 31 38 2d 30 37 2d 31 35 54 31 33 3a D 2018-07-15T13:
0010: 34 30 3a 32 32 2e 38 37 37 0a 4c 20 70 6f 72 74 40:22.877.L port
0020: 2d 66 6f 72 77 61 72 64 69 6e 67 0a 50 20 62 62 -forwarding.P bb
0030: 62 65 30 66 63 30 35 62 31 34 38 34 65 66 36 63 be0fc05b1484ef6c
0040: 38 36 66 37 63 34 36 34 32 61 61 37 63 65 39 30 86f7c4642aa7ce90
0050: 36 62 33 38 33 35 0a 55 20 73 61 6e 64 72 6f 0a 6b3835.U sandro.
0060: 57 20 39 30 35 39 0a 42 61 63 6b 20 74 6f 20 74 W 9059.Back to t
0070: 68 65 20 3c 62 3e 56 69 72 74 75 61 6c 50 47 3c he <b>VirtualPG<
0080: 2f 62 3e 20 3c 61 20 68 72 65 66 3d 22 68 74 74 /b> <a href="htt
0090: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
00a0: 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 76 69 72 74 s.it/fossil/virt
00b0: 75 61 6c 70 67 2f 77 69 6b 69 3f 6e 61 6d 65 3d ualpg/wiki?name=
00c0: 74 75 74 6f 72 69 61 6c 22 3e 74 75 74 6f 72 69 tutorial">tutori
00d0: 61 6c 3c 2f 61 3e 0d 0a 3c 62 72 3e 3c 62 72 3e al</a>..<br><br>
00e0: 0d 0a 3c 68 32 3e 43 6f 6e 6e 65 63 74 69 6e 67 ..<h2>Connecting
00f0: 20 74 6f 20 61 20 72 65 6d 6f 74 65 20 50 6f 73 to a remote Pos
0100: 74 67 72 65 53 51 4c 20 73 65 72 76 65 72 20 76 tgreSQL server v
0110: 69 61 20 50 6f 72 74 20 46 6f 72 77 61 72 64 69 ia Port Forwardi
0120: 6e 67 20 2f 20 53 53 48 20 54 75 6e 6e 65 6c 69 ng / SSH Tunneli
0130: 6e 67 3c 2f 68 32 3e 0d 0a 54 68 65 20 77 65 6c ng</h2>..The wel
0140: 6c 20 6b 6e 6f 77 6e 20 3c 62 3e 53 53 48 3c 2f l known <b>SSH</
0150: 62 3e 20 28 3c 69 3e 3c 62 3e 53 3c 2f 62 3e 65 b> (<i><b>S</b>e
0160: 63 75 72 65 20 3c 62 3e 53 48 3c 2f 62 3e 65 6c cure <b>SH</b>el
0170: 6c 3c 2f 69 3e 29 20 3c 61 20 68 72 65 66 3d 22 l</i>) <a href="
0180: 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 https://en.wikip
0190: 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 53 65 edia.org/wiki/Se
01a0: 63 75 72 65 5f 53 68 65 6c 6c 22 3e 70 72 6f 74 cure_Shell">prot
01b0: 6f 63 6f 6c 3c 2f 61 3e 20 69 73 20 76 65 72 79 ocol</a> is very
01c0: 20 66 72 65 71 75 65 6e 74 6c 79 20 61 64 6f 70 frequently adop
01d0: 74 65 64 20 62 79 20 73 79 73 74 65 6d 20 61 64 ted by system ad
01e0: 6d 69 6e 69 73 74 72 61 74 6f 72 73 20 66 6f 72 ministrators for
01f0: 20 65 73 74 61 62 6c 69 73 68 69 6e 67 20 73 61 establishing sa
0200: 66 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 74 fe connections t
0210: 6f 20 72 65 6d 6f 74 65 20 73 65 72 76 65 72 73 o remote servers
0220: 2e 3c 62 72 3e 0d 0a 53 53 48 20 61 75 74 6f 6d .<br>..SSH autom
0230: 61 74 69 63 61 6c 6c 79 20 65 6e 63 72 79 70 74 atically encrypt
0240: 73 20 61 6c 6c 20 74 68 65 20 74 72 61 66 66 69 s all the traffi
0250: 63 20 62 65 74 77 65 65 6e 20 74 68 65 20 6c 6f c between the lo
0260: 63 61 6c 20 50 43 20 61 6e 64 20 74 68 65 20 72 cal PC and the r
0270: 65 6d 6f 74 65 20 73 65 72 76 65 72 20 62 79 20 emote server by
0280: 75 73 69 6e 67 20 73 74 72 6f 6e 67 20 63 72 79 using strong cry
0290: 70 74 6f 67 72 61 68 69 63 20 63 69 70 68 65 72 ptograhic cipher
02a0: 73 2c 20 74 68 75 73 20 61 6c 6c 6f 77 69 6e 67 s, thus allowing
02b0: 20 66 6f 72 20 76 65 72 79 20 73 65 63 75 72 65 for very secure
02c0: 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 6f 76 65 connections ove
02d0: 72 20 74 68 65 20 69 6e 74 72 69 6e 73 69 63 61 r the intrinsica
02e0: 6c 6c 79 20 69 6e 73 65 63 75 72 65 20 49 6e 74 lly insecure Int
02f0: 65 72 6e 65 74 2e 3c 62 72 3e 3c 62 72 3e 0d 0a ernet.<br><br>..
0300: 59 6f 75 20 63 61 6e 20 75 73 65 20 53 53 48 20 You can use SSH
0310: 61 6c 73 6f 20 66 6f 72 20 65 73 74 61 62 6c 69 also for establi
0320: 73 68 69 6e 67 20 73 61 66 65 20 63 6f 6e 6e 65 shing safe conne
0330: 63 74 69 6f 6e 73 20 74 6f 20 72 65 6d 6f 74 65 ctions to remote
0340: 20 50 6f 73 74 67 72 65 53 51 4c 20 73 65 72 76 PostgreSQL serv
0350: 65 72 73 2c 20 62 75 74 20 74 68 69 73 20 72 65 ers, but this re
0360: 71 75 69 72 65 73 20 74 6f 20 61 63 74 69 76 61 quires to activa
0370: 74 65 20 73 6f 6d 65 20 73 70 65 63 69 61 6c 20 te some special
0380: 53 53 48 20 66 65 61 74 75 72 65 20 6b 6e 6f 77 SSH feature know
0390: 6e 20 61 73 20 3c 61 20 68 72 65 66 3d 22 68 74 n as <a href="ht
03a0: 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 tps://en.wikiped
03b0: 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 50 6f 72 74 ia.org/wiki/Port
03c0: 5f 66 6f 72 77 61 72 64 69 6e 67 22 3e 70 6f 72 _forwarding">por
03d0: 74 20 66 6f 72 77 61 72 64 69 6e 67 3c 2f 61 3e t forwarding</a>
03e0: 20 61 6b 61 20 3c 61 20 68 72 65 66 3d 22 68 74 aka <a href="ht
03f0: 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 tps://en.wikiped
0400: 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 54 75 6e 6e ia.org/wiki/Tunn
0410: 65 6c 69 6e 67 5f 70 72 6f 74 6f 63 6f 6c 22 3e eling_protocol">
0420: 53 53 48 20 74 75 6e 6e 65 6c 69 6e 67 3c 2f 61 SSH tunneling</a
0430: 3e 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e >.<br><br>..<hr>
0440: 20 0d 0a 3c 68 32 3e 42 61 73 69 63 20 63 6f 6e ..<h2>Basic con
0450: 63 65 70 74 73 3c 2f 68 32 3e 0d 0a 3c 69 6d 67 cepts</h2>..<img
0460: 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 src="https://ww
0470: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 w.gaia-gis.it/ga
0480: 69 61 2d 73 69 6e 73 2f 70 6f 72 74 2d 66 6f 72 ia-sins/port-for
0490: 77 61 72 64 69 6e 67 2d 73 73 68 2d 74 75 6e 6e warding-ssh-tunn
04a0: 65 6c 2f 53 73 68 2d 70 6f 72 74 2d 66 6f 72 77 el/Ssh-port-forw
04b0: 61 72 64 69 6e 67 2e 70 6e 67 22 20 61 6c 74 3d arding.png" alt=
04c0: 22 70 6f 72 74 2d 66 6f 72 77 61 72 64 69 6e 67 "port-forwarding
04d0: 22 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 62 3e 54 "><br><br>..<b>T
04e0: 68 65 20 70 72 6f 62 6c 65 6d 3c 2f 62 3e 3a 20 he problem</b>:
04f0: 79 6f 75 20 61 72 65 20 61 74 74 65 6d 70 74 69 you are attempti
0500: 6e 67 20 74 6f 20 65 73 74 61 62 6c 69 73 68 20 ng to establish
0510: 61 20 6e 65 74 77 6f 72 6b 20 63 6f 6e 6e 65 63 a network connec
0520: 74 69 6f 6e 20 62 65 74 77 65 65 6e 20 79 6f 75 tion between you
0530: 72 20 6c 6f 63 61 6c 20 6d 61 63 68 69 6e 65 20 r local machine
0540: 61 6e 64 20 61 20 72 65 6d 6f 74 65 20 73 65 72 and a remote ser
0550: 76 65 72 20 6f 6e 20 49 50 20 50 6f 72 74 20 3c ver on IP Port <
0560: 62 3e 36 36 36 37 3c 2f 62 3e 2e 3c 62 72 3e 0d b>6667</b>.<br>.
0570: 0a 42 75 74 20 74 68 69 73 20 69 73 20 69 6d 70 .But this is imp
0580: 6f 73 73 69 62 6c 65 2c 20 62 65 63 61 75 73 65 ossible, because
0590: 20 74 68 65 20 46 69 72 65 77 61 6c 6c 20 66 6f the Firewall fo
05a0: 72 62 69 64 73 20 61 6e 79 20 63 6f 6e 6e 65 63 rbids any connec
05b0: 74 69 6f 6e 20 74 6f 20 70 6f 72 74 20 36 36 36 tion to port 666
05c0: 37 20 28 72 65 70 72 65 73 65 6e 74 65 64 20 69 7 (represented i
05d0: 6e 20 74 68 65 20 61 62 6f 76 65 20 66 69 67 75 n the above figu
05e0: 72 65 20 62 79 20 74 68 65 20 3c 69 3e 3c 62 3e re by the <i><b>
05f0: 72 65 64 20 61 72 72 6f 77 3c 2f 62 3e 3c 2f 69 red arrow</b></i
0600: 3e 29 3b 20 61 6e 64 20 74 68 65 72 65 20 69 73 >); and there is
0610: 20 61 20 76 65 72 79 20 67 6f 6f 64 20 72 65 61 a very good rea
0620: 73 6f 6e 20 66 6f 72 20 64 6f 69 6e 67 20 74 68 son for doing th
0630: 69 73 2e 3c 62 72 3e 0d 0a 49 66 20 70 6f 72 74 is.<br>..If port
0640: 20 36 36 36 37 20 77 61 73 20 65 6e 61 62 6c 65 6667 was enable
0650: 64 20 74 6f 20 61 63 63 65 70 74 20 61 6e 79 20 d to accept any
0660: 69 6e 63 6f 6d 69 6e 67 20 74 72 61 66 66 69 63 incoming traffic
0670: 20 66 72 6f 6d 20 74 68 65 20 6f 75 74 73 69 64 from the outsid
0680: 65 20 74 68 69 73 20 63 6f 75 6c 64 20 70 6f 73 e this could pos
0690: 65 20 61 20 73 65 76 65 72 65 20 73 65 63 75 72 e a severe secur
06a0: 69 74 79 20 62 72 65 61 63 68 2c 20 62 65 63 61 ity breach, beca
06b0: 75 73 65 20 61 6e 79 6f 6e 65 20 28 61 6e 64 20 use anyone (and
06c0: 6e 6f 74 20 79 6f 75 20 6f 6e 6c 79 29 20 63 6f not you only) co
06d0: 75 6c 64 20 66 72 65 65 6c 79 20 63 6f 6e 6e 65 uld freely conne
06e0: 63 74 20 74 6f 20 74 68 65 20 73 65 72 76 65 72 ct to the server
06f0: 2e 3c 62 72 3e 0d 0a 45 76 65 6e 20 77 6f 72 73 .<br>..Even wors
0700: 74 2c 20 74 68 65 20 74 72 61 66 66 69 63 20 6f t, the traffic o
0710: 76 65 72 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 ver the connecti
0720: 6f 6e 20 77 6f 75 6c 64 20 62 65 20 75 6e 63 79 on would be uncy
0730: 70 68 65 72 65 64 2c 20 61 6e 64 20 63 6f 6e 73 phered, and cons
0740: 65 71 75 65 6e 74 6c 79 20 76 65 72 79 20 65 61 equently very ea
0750: 73 79 20 74 6f 20 62 65 20 6d 61 6c 69 63 69 6f sy to be malicio
0760: 75 73 6c 79 20 69 6e 74 65 72 63 65 70 74 65 64 usly intercepted
0770: 20 6f 72 20 66 61 6c 73 69 66 69 65 64 2e 3c 62 or falsified.<b
0780: 72 3e 3c 62 72 3e 0d 0a 3c 62 3e 54 68 65 20 70 r><br>..<b>The p
0790: 65 72 66 65 63 74 20 73 6f 6c 75 74 69 6f 6e 3c erfect solution<
07a0: 2f 62 3e 3a 20 61 73 20 77 65 27 76 65 20 61 6c /b>: as we've al
07b0: 72 65 61 64 79 20 73 65 65 6e 2c 20 74 68 65 20 ready seen, the
07c0: 53 53 48 20 70 72 6f 74 6f 63 6f 6c 20 77 61 73 SSH protocol was
07d0: 20 69 6e 76 65 6e 74 65 64 20 66 6f 72 20 65 6e invented for en
07e0: 73 75 72 69 6e 67 20 72 6f 62 75 73 74 6c 79 20 suring robustly
07f0: 73 61 66 65 20 65 6e 63 72 79 70 74 65 64 20 6e safe encrypted n
0800: 65 74 77 6f 72 6b 20 63 6f 6e 6e 65 63 74 69 6f etwork connectio
0810: 6e 73 2e 3c 62 72 3e 0d 0a 54 68 65 20 73 74 61 ns.<br>..The sta
0820: 6e 64 61 72 64 20 49 50 20 50 6f 72 74 20 66 6f ndard IP Port fo
0830: 72 20 53 53 48 20 69 73 20 3c 62 3e 32 32 3c 2f r SSH is <b>22</
0840: 62 3e 2c 20 61 6e 64 20 66 69 72 65 77 61 6c 6c b>, and firewall
0850: 73 20 61 72 65 20 75 73 75 61 6c 6c 79 20 63 6f s are usually co
0860: 6e 66 69 67 75 72 65 64 20 73 6f 20 74 6f 20 61 nfigured so to a
0870: 6c 6c 6f 77 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 llow connections
0880: 20 6f 6e 20 70 6f 72 74 20 32 32 20 28 3c 69 3e on port 22 (<i>
0890: 3c 62 3e 67 72 65 65 6e 20 61 72 72 6f 77 3c 2f <b>green arrow</
08a0: 62 3e 3c 2f 69 3e 29 2e 3c 62 72 3e 0d 0a 53 6f b></i>).<br>..So
08b0: 20 77 65 20 6a 75 73 74 20 72 65 71 75 69 72 65 we just require
08c0: 20 73 6f 6d 65 20 61 70 70 72 6f 70 72 69 61 74 some appropriat
08d0: 65 20 3c 69 3e 3c 62 3e 6d 61 67 69 63 20 74 72 e <i><b>magic tr
08e0: 69 63 6b 3c 2f 62 3e 3c 2f 69 3e 20 63 61 70 61 ick</b></i> capa
08f0: 62 6c 65 20 6f 66 20 3c 62 3e 74 75 6e 6e 65 6c ble of <b>tunnel
0900: 69 6e 67 3c 2f 62 3e 20 6f 75 72 20 6f 77 6e 20 ing</b> our own
0910: 74 72 61 66 66 69 63 20 6f 76 65 72 20 61 6e 20 traffic over an
0920: 53 53 48 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e 20 SSH connection.
0930: 4c 65 74 27 73 20 73 65 65 20 69 6e 20 66 75 6c Let's see in ful
0940: 6c 20 64 65 74 61 69 6c 20 68 6f 77 20 69 74 20 l detail how it
0950: 77 6f 72 6b 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c works:..<ul>..<l
0960: 69 3e 6f 6e 20 79 6f 75 72 20 6c 6f 63 61 6c 65 i>on your locale
0970: 20 6d 61 63 68 69 6e 65 20 74 68 73 20 53 53 48 machine ths SSH
0980: 20 63 6c 69 65 6e 74 20 77 69 6c 6c 20 73 74 61 client will sta
0990: 72 74 20 6c 69 73 74 65 6e 69 6e 67 20 61 74 20 rt listening at
09a0: 70 6f 72 74 20 3c 62 3e 31 32 33 34 3c 2f 62 3e port <b>1234</b>
09b0: 20 28 79 6f 75 20 63 61 6e 20 61 63 74 75 61 6c (you can actual
09c0: 79 20 66 72 65 65 6c 79 20 63 6f 6e 66 69 67 75 y freely configu
09d0: 72 65 20 61 6e 79 20 75 6e 75 73 65 64 20 49 50 re any unused IP
09e0: 20 50 6f 72 74 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c Port).</li>..<l
09f0: 69 3e 74 68 65 20 53 53 48 20 63 6c 69 65 6e 74 i>the SSH client
0a00: 20 77 69 6c 6c 20 65 6e 63 72 79 70 74 20 61 6e will encrypt an
0a10: 79 20 64 61 74 61 20 72 65 63 65 69 76 65 64 20 y data received
0a20: 6f 6e 20 6c 6f 63 61 6c 20 70 6f 72 74 20 31 32 on local port 12
0a30: 33 34 2c 20 61 6e 64 20 77 69 6c 6c 20 73 65 6e 34, and will sen
0a40: 64 20 74 68 65 20 72 65 73 75 6c 74 69 6e 67 20 d the resulting
0a50: 74 72 61 66 66 69 63 20 74 6f 20 74 68 65 20 72 traffic to the r
0a60: 65 6d 6f 74 65 20 73 65 72 76 65 72 20 6f 6e 20 emote server on
0a70: 74 68 65 20 73 74 61 6e 64 61 72 64 20 53 53 48 the standard SSH
0a80: 20 70 6f 72 74 2c 20 74 68 61 74 20 69 73 20 32 port, that is 2
0a90: 32 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 2.</li>..<li>the
0aa0: 20 53 53 48 20 73 65 72 76 65 72 20 28 6f 6e 20 SSH server (on
0ab0: 74 68 65 20 72 65 6d 6f 74 65 20 6d 61 63 68 69 the remote machi
0ac0: 6e 65 29 20 77 69 6c 6c 20 65 78 61 6d 69 6e 65 ne) will examine
0ad0: 20 74 68 65 20 69 6e 63 6f 6d 69 6e 67 20 74 72 the incoming tr
0ae0: 61 66 66 69 63 2c 20 61 6e 64 20 77 69 6c 6c 20 affic, and will
0af0: 72 65 63 6f 67 6e 69 7a 65 20 61 20 74 75 6e 6e recognize a tunn
0b00: 65 6c 6c 65 64 20 72 65 71 75 65 73 74 2e 3c 62 elled request.<b
0b10: 72 3e 0d 0a 43 6f 6e 73 65 71 75 65 6e 74 6c 79 r>..Consequently
0b20: 20 69 74 20 77 69 6c 6c 20 75 6e 63 79 70 68 65 it will uncyphe
0b30: 72 20 74 68 65 20 6d 65 73 73 61 67 65 2c 20 61 r the message, a
0b40: 6e 64 20 77 69 6c 6c 20 66 6f 72 77 61 72 64 20 nd will forward
0b50: 74 68 65 20 70 6c 61 69 6e 20 64 61 74 61 20 74 the plain data t
0b60: 6f 20 6c 6f 63 61 6c 20 70 6f 72 74 20 3c 62 3e o local port <b>
0b70: 36 36 36 37 3c 2f 62 3e 2c 20 61 67 61 69 6e 20 6667</b>, again
0b80: 6f 6e 20 74 68 65 20 72 65 6d 6f 74 65 20 73 65 on the remote se
0b90: 72 76 65 72 20 28 3c 69 3e 3c 62 3e 76 69 6f 6c rver (<i><b>viol
0ba0: 65 74 20 61 72 72 6f 77 3c 2f 62 3e 3c 2f 69 3e et arrow</b></i>
0bb0: 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 73 79 6d ).</li>..<li>sym
0bc0: 6d 65 74 72 69 63 61 6c 20 61 63 74 69 6f 6e 73 metrical actions
0bd0: 20 77 69 6c 6c 20 68 61 70 70 65 6e 20 69 6e 20 will happen in
0be0: 72 65 76 65 72 73 65 20 6f 72 64 65 72 20 66 6f reverse order fo
0bf0: 72 20 74 75 6e 6e 65 6c 69 6e 67 20 74 68 65 20 r tunneling the
0c00: 73 65 72 76 65 72 27 73 20 72 65 73 70 6f 6e 73 server's respons
0c10: 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 e.</li>..<li>the
0c20: 20 66 69 6e 61 6c 20 6e 65 74 20 65 66 66 65 63 final net effec
0c30: 74 20 6f 66 20 73 75 63 68 20 61 6e 20 3c 62 3e t of such an <b>
0c40: 3c 69 3e 53 53 48 20 74 75 6e 6e 65 6c 3c 2f 69 <i>SSH tunnel</i
0c50: 3e 3c 2f 62 3e 20 69 73 20 74 68 61 74 20 6e 6f ></b> is that no
0c60: 77 20 70 6f 72 74 20 3c 62 3e 31 32 33 34 3c 2f w port <b>1234</
0c70: 62 3e 20 6f 6e 20 74 68 65 20 6c 6f 63 61 6c 20 b> on the local
0c80: 6d 61 63 68 69 6e 65 20 77 69 6c 6c 20 62 65 20 machine will be
0c90: 3c 62 3e 3c 69 3e 66 6f 72 77 61 72 64 65 64 3c <b><i>forwarded<
0ca0: 2f 69 3e 3c 2f 62 3e 20 74 6f 20 70 6f 72 74 20 /i></b> to port
0cb0: 3c 62 3e 36 36 36 37 3c 2f 62 3e 20 6f 6e 20 74 <b>6667</b> on t
0cc0: 68 65 20 72 65 6d 6f 74 65 20 73 65 72 76 65 72 he remote server
0cd0: 2c 20 61 6e 64 20 76 69 63 65 20 76 65 72 73 61 , and vice versa
0ce0: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c .</li>..</ul>..<
0cf0: 62 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c br><br>..<hr>..<
0d00: 68 32 3e 48 6f 77 2d 74 6f 20 63 6f 6e 66 69 67 h2>How-to config
0d10: 75 72 65 20 50 6f 72 74 20 46 6f 72 77 61 72 64 ure Port Forward
0d20: 69 6e 67 3c 2f 68 32 3e 0d 0a 57 65 27 6c 6c 20 ing</h2>..We'll
0d30: 73 75 70 70 6f 73 65 20 74 68 61 74 20 73 6f 6d suppose that som
0d40: 65 20 3c 62 3e 53 53 48 20 73 65 72 76 65 72 3c e <b>SSH server<
0d50: 2f 62 3e 20 77 69 6c 6c 20 62 65 20 61 6c 72 65 /b> will be alre
0d60: 61 64 79 20 69 6e 73 74 61 6c 6c 65 64 20 61 6e ady installed an
0d70: 64 20 63 6f 6e 66 69 67 75 72 65 64 20 6f 6e 20 d configured on
0d80: 74 68 65 20 72 65 6d 6f 74 65 20 73 65 72 76 65 the remote serve
0d90: 72 2c 20 61 6e 64 20 74 68 61 74 20 74 68 65 20 r, and that the
0da0: 46 69 72 65 77 61 6c 6c 20 63 6f 6e 66 69 67 75 Firewall configu
0db0: 72 61 74 69 6f 6e 20 77 69 6c 6c 20 61 63 63 65 ration will acce
0dc0: 70 74 20 65 78 74 65 72 6e 61 6c 20 63 6f 6e 6e pt external conn
0dd0: 65 63 74 69 6f 6e 73 20 6f 6e 20 70 6f 72 74 20 ections on port
0de0: 32 32 2e 3c 62 72 3e 0d 0a 49 66 20 6e 6f 74 2c 22.<br>..If not,
0df0: 20 70 6c 65 61 73 65 20 63 68 65 63 6b 20 74 68 please check th
0e00: 65 20 61 70 70 72 6f 70 72 69 61 74 65 20 64 6f e appropriate do
0e10: 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 3c 62 72 3e cumentation.<br>
0e20: 0d 0a 3c 61 20 68 72 65 66 3d 22 22 3e 4f 70 65 ..<a href="">Ope
0e30: 6e 53 53 48 3c 2f 61 3e 20 28 62 6f 74 68 20 63 nSSH</a> (both c
0e40: 6c 69 65 6e 74 20 61 6e 64 20 73 65 72 76 65 72 lient and server
0e50: 29 20 69 73 20 61 6c 6d 6f 73 74 20 75 6e 69 76 ) is almost univ
0e60: 65 72 73 61 6c 6c 79 20 73 75 70 70 6f 72 74 65 ersally supporte
0e70: 64 20 62 79 20 61 6c 6c 20 4c 69 6e 75 78 20 64 d by all Linux d
0e80: 69 73 74 72 6f 73 20 61 6e 64 20 62 79 20 6d 61 istros and by ma
0e90: 6e 79 20 55 6e 69 78 2d 6c 69 6b 65 20 73 79 73 ny Unix-like sys
0ea0: 74 65 6d 73 2c 20 74 68 69 73 20 69 6e 63 6c 75 tems, this inclu
0eb0: 64 69 6e 67 20 4d 61 63 20 4f 53 20 58 2e 3c 62 ding Mac OS X.<b
0ec0: 72 3e 3c 62 72 3e 0d 0a 4f 6e 63 65 20 65 6e 73 r><br>..Once ens
0ed0: 75 72 65 64 20 74 68 61 74 20 61 6e 79 74 68 69 ured that anythi
0ee0: 6e 67 20 69 73 20 63 6f 72 72 65 63 74 6c 79 20 ng is correctly
0ef0: 77 6f 72 6b 69 6e 67 20 6f 6e 20 74 68 65 20 73 working on the s
0f00: 65 72 76 65 72 20 73 69 64 65 2c 20 73 65 74 74 erver side, sett
0f10: 69 6e 67 20 75 70 20 3c 62 3e 3c 69 3e 50 6f 72 ing up <b><i>Por
0f20: 74 20 46 6f 72 77 61 72 64 69 6e 67 3c 2f 69 3e t Forwarding</i>
0f30: 3c 2f 62 3e 20 2f 20 3c 62 3e 3c 69 3e 53 53 48 </b> / <b><i>SSH
0f40: 20 54 75 6e 6e 65 6c 69 6e 67 3c 2f 69 3e 3c 2f Tunneling</i></
0f50: 62 3e 20 6a 75 73 74 20 72 65 71 75 69 72 65 73 b> just requires
0f60: 20 66 65 77 20 73 69 6d 70 6c 65 20 61 63 74 69 few simple acti
0f70: 6f 6e 73 20 6f 6e 20 74 68 65 20 63 6c 69 65 6e ons on the clien
0f80: 74 20 73 69 64 65 20 28 79 6f 75 72 20 6c 6f 63 t side (your loc
0f90: 61 6c 20 6d 61 63 68 69 6e 65 29 2e 3c 62 72 3e al machine).<br>
0fa0: 0d 0a 55 6e 68 61 70 70 69 6c 79 20 74 68 69 73 ..Unhappily this
0fb0: 20 69 73 20 71 75 69 74 65 20 64 69 66 66 65 72 is quite differ
0fc0: 65 6e 74 20 6f 6e 20 55 6e 69 78 2d 6c 69 6b 65 ent on Unix-like
0fd0: 20 73 79 73 74 65 6d 73 20 61 6e 64 20 6f 6e 20 systems and on
0fe0: 4d 53 20 57 69 6e 64 6f 77 73 2c 20 73 6f 20 77 MS Windows, so w
0ff0: 65 27 6c 6c 20 65 78 61 6d 69 6e 65 20 65 61 63 e'll examine eac
1000: 68 20 6f 66 20 74 68 65 6d 20 73 65 70 61 72 61 h of them separa
1010: 74 65 6c 79 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d tely...<br><br>.
1020: 0a 3c 68 72 3e 0d 0a 3c 68 32 3e 43 6f 6e 66 69 .<hr>..<h2>Confi
1030: 67 75 72 69 6e 67 20 50 6f 72 74 20 46 6f 72 77 guring Port Forw
1040: 61 72 64 69 6e 67 20 6f 6e 20 4c 69 6e 75 78 3c arding on Linux<
1050: 2f 68 32 3e 0d 0a 3c 62 3e 4e 6f 74 65 3c 2f 62 /h2>..<b>Note</b
1060: 3e 3a 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 >: the following
1070: 20 64 69 72 65 63 74 69 76 65 73 20 61 72 65 20 directives are
1080: 73 75 70 70 6f 73 65 64 20 74 6f 20 62 65 20 76 supposed to be v
1090: 61 6c 69 64 20 6f 6e 20 61 6e 79 20 55 6e 69 78 alid on any Unix
10a0: 2d 6c 69 6b 65 20 73 79 73 74 65 6d 2c 20 72 61 -like system, ra
10b0: 6e 67 69 6e 67 20 66 72 6f 6d 20 4c 69 6e 75 78 nging from Linux
10c0: 20 74 6f 20 4f 70 65 6e 42 53 44 2c 20 4d 61 63 to OpenBSD, Mac
10d0: 20 4f 53 20 58 20 61 6e 64 20 61 6c 69 6b 65 2e OS X and alike.
10e0: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 69 6d 67 20 73 <br><br>..<img s
10f0: 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e rc="https://www.
1100: 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 gaia-gis.it/gaia
1110: 2d 73 69 6e 73 2f 70 6f 72 74 2d 66 6f 72 77 61 -sins/port-forwa
1120: 72 64 69 6e 67 2d 73 73 68 2d 74 75 6e 6e 65 6c rding-ssh-tunnel
1130: 2f 73 73 68 2d 74 75 6e 6e 65 6c 2e 70 6e 67 22 /ssh-tunnel.png"
1140: 20 61 6c 74 3d 22 73 73 68 2d 74 75 6e 6e 65 6c alt="ssh-tunnel
1150: 22 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 6f 6c 3e "><br><br>..<ol>
1160: 0d 0a 3c 6c 69 3e 66 72 6f 6d 20 74 68 65 20 73 ..<li>from the s
1170: 68 65 6c 6c 2c 20 6c 61 75 6e 63 68 20 61 20 63 hell, launch a c
1180: 6f 6d 6d 61 6e 64 20 6c 69 6b 65 20 74 68 69 73 ommand like this
1190: 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e :..<ul>..<li><b>
11a0: 73 73 68 20 2d 4c 20 35 34 33 32 31 3a 6c 6f 63 ssh -L 54321:loc
11b0: 61 6c 68 6f 73 74 3a 35 34 33 32 20 73 61 6e 64 alhost:5432 sand
11c0: 72 6f 40 31 39 32 2e 31 36 38 2e 31 2e 36 36 3c ro@192.168.1.66<
11d0: 2f 62 3e 3c 62 72 3e 0d 0a 77 68 65 72 65 3c 75 /b><br>..where<u
11e0: 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 73 73 68 3c 2f l>..<li><b>ssh</
11f0: 62 3e 20 69 73 20 74 68 65 20 4f 70 65 6e 53 53 b> is the OpenSS
1200: 48 20 63 6c 69 65 6e 74 20 70 72 6f 67 72 61 6d H client program
1210: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 2d .</li>..<li><b>-
1220: 4c 3c 2f 62 3e 20 69 73 20 61 20 66 6c 61 67 20 L</b> is a flag
1230: 65 6e 61 62 6c 69 6e 67 20 53 53 48 20 54 75 6e enabling SSH Tun
1240: 6e 65 6c 69 6e 67 20 2f 20 50 6f 72 74 20 46 6f neling / Port Fo
1250: 72 77 61 72 64 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a rwarding.</li>..
1260: 3c 6c 69 3e 3c 62 3e 35 34 33 32 31 3a 6c 6f 63 <li><b>54321:loc
1270: 61 6c 68 6f 73 74 3a 35 34 33 32 3c 2f 62 3e 20 alhost:5432</b>
1280: 73 70 65 63 69 66 69 65 73 20 74 68 65 20 50 6f specifies the Po
1290: 72 74 20 46 6f 72 77 61 72 64 69 6e 67 20 63 6f rt Forwarding co
12a0: 6e 66 69 67 75 72 61 74 69 6f 6e 2e 3c 62 72 3e nfiguration.<br>
12b0: 0d 0a 70 61 79 20 63 6c 6f 73 65 20 61 74 74 65 ..pay close atte
12c0: 6e 74 69 6f 6e 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c ntion:..<ul>..<l
12d0: 69 3e 3c 62 3e 35 34 33 32 31 3c 2f 62 3e 20 69 i><b>54321</b> i
12e0: 73 20 74 68 65 20 49 50 20 70 6f 72 74 20 3c 62 s the IP port <b
12f0: 3e 3c 69 3e 6f 6e 20 79 6f 75 72 20 6c 6f 63 61 ><i>on your loca
1300: 6c 20 6d 61 63 68 69 6e 65 3c 2f 69 3e 3c 2f 62 l machine</i></b
1310: 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e >.</li>..<li><b>
1320: 35 34 33 32 3c 2f 62 3e 20 69 73 20 74 68 65 20 5432</b> is the
1330: 63 61 6e 6f 6e 69 63 61 6c 20 70 6f 72 74 20 6c canonical port l
1340: 69 73 74 65 6e 64 65 64 20 62 79 20 50 6f 73 74 istended by Post
1350: 67 72 65 53 51 4c 20 3c 62 3e 3c 69 3e 6f 6e 20 greSQL <b><i>on
1360: 74 68 65 20 72 65 6d 6f 74 65 20 73 65 72 76 65 the remote serve
1370: 72 3c 2f 69 3e 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d r</i></b>.</li>.
1380: 0a 3c 6c 69 3e 61 6e 20 53 53 48 20 54 75 6e 6e .<li>an SSH Tunn
1390: 65 6c 20 6c 69 6b 65 20 74 68 69 73 20 77 69 6c el like this wil
13a0: 6c 20 66 6f 72 77 61 72 64 20 79 6f 75 72 20 6c l forward your l
13b0: 6f 63 61 6c 20 70 6f 72 74 20 35 34 33 32 31 20 ocal port 54321
13c0: 64 69 72 65 63 74 6c 79 20 74 6f 20 50 6f 73 74 directly to Post
13d0: 67 72 65 53 51 4c 20 6f 6e 20 74 68 65 20 73 65 greSQL on the se
13e0: 72 76 65 72 20 28 70 6f 72 74 20 35 34 33 32 29 rver (port 5432)
13f0: 2e 3c 62 72 3e 0d 0a 69 6e 20 6f 74 68 65 72 20 .<br>..in other
1400: 77 6f 72 64 73 2c 20 79 6f 75 20 61 72 65 20 6e words, you are n
1410: 6f 77 20 61 62 6c 65 20 74 6f 20 63 6f 6e 6e 65 ow able to conne
1420: 63 74 20 61 6e 79 20 50 6f 73 74 67 72 65 53 51 ct any PostgreSQ
1430: 4c 20 63 6c 69 65 6e 74 20 74 6f 20 74 68 65 20 L client to the
1440: 6c 6f 63 61 6c 20 70 6f 72 74 20 31 32 33 34 35 local port 12345
1450: 20 61 6e 64 20 61 20 63 6f 6e 6e 65 63 74 69 6f and a connectio
1460: 6e 20 74 6f 20 74 68 65 20 72 65 6d 6f 74 65 20 n to the remote
1470: 50 6f 73 74 67 72 65 53 51 4c 20 77 69 6c 6c 20 PostgreSQL will
1480: 62 65 20 3c 62 3e 3c 69 3e 6d 61 67 69 63 61 6c be <b><i>magical
1490: 6c 79 3c 2f 69 3e 3c 2f 62 3e 20 65 73 74 61 62 ly</i></b> estab
14a0: 6c 69 73 68 65 64 2e 3c 62 72 3e 0d 0a 61 6e 64 lished.<br>..and
14b0: 20 74 68 69 73 20 50 6f 73 74 67 72 65 53 51 4c this PostgreSQL
14c0: 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 77 69 6c 6c connection will
14d0: 20 62 65 20 72 6f 62 75 73 74 6c 79 20 63 79 70 be robustly cyp
14e0: 68 65 72 65 64 2c 20 74 68 75 73 20 65 6e 73 75 hered, thus ensu
14f0: 72 69 6e 67 20 6d 61 78 69 6d 75 6d 20 73 61 66 ring maximum saf
1500: 65 74 79 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e ety.</li>..</ul>
1510: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6e 64 20 3c </li>..<li>and <
1520: 62 3e 73 61 6e 64 72 6f 40 31 39 32 2e 31 36 38 b>sandro@192.168
1530: 2e 31 36 36 3c 2f 62 3e 20 73 70 65 63 69 66 69 .166</b> specifi
1540: 65 73 20 74 68 65 20 3c 62 3e 3c 69 3e 75 73 65 es the <b><i>use
1550: 72 20 6e 61 6d 65 3c 2f 69 3e 3c 2f 62 3e 20 61 r name</i></b> a
1560: 6e 64 20 74 68 65 20 3c 62 3e 3c 69 3e 49 50 20 nd the <b><i>IP
1570: 61 64 64 72 65 73 73 3c 2f 69 3e 3c 2f 62 3e 20 address</i></b>
1580: 6f 66 20 74 68 65 20 72 65 6d 6f 74 65 20 73 65 of the remote se
1590: 72 76 65 72 2e 3c 62 72 3e 0d 0a 3c 62 3e 4e 6f rver.<br>..<b>No
15a0: 74 65 3c 2f 62 3e 3a 20 79 6f 75 20 63 6f 75 6c te</b>: you coul
15b0: 64 20 65 76 65 6e 74 75 61 6c 6c 79 20 69 64 65 d eventually ide
15c0: 6e 74 69 66 79 20 74 68 65 20 72 65 6d 6f 74 65 ntify the remote
15d0: 20 73 65 72 76 65 72 20 62 79 20 69 74 73 20 3c server by its <
15e0: 62 3e 3c 69 3e 64 6f 6d 61 69 6e 20 6e 61 6d 65 b><i>domain name
15f0: 3c 2f 69 3e 3c 2f 62 3e 2c 20 73 75 63 68 20 61 </i></b>, such a
1600: 73 20 69 6e 20 3c 62 3e 6a 6f 65 40 77 77 77 2e s in <b>joe@www.
1610: 75 74 6f 70 69 61 2e 6f 72 67 3c 2f 62 3e 2e 3c utopia.org</b>.<
1620: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e /li>..</ul></li>
1630: 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c ..</ul></li>..<l
1640: 69 3e 65 78 65 63 75 74 65 20 74 68 65 20 61 62 i>execute the ab
1650: 6f 76 65 20 63 6f 6d 6d 61 6e 64 3a 20 79 6f 75 ove command: you
1660: 27 6c 6c 20 62 65 20 61 73 6b 65 64 20 66 6f 72 'll be asked for
1670: 20 74 68 65 20 3c 62 3e 70 61 73 73 77 6f 72 64 the <b>password
1680: 3c 2f 62 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69 </b> correspondi
1690: 6e 67 20 74 6f 20 74 68 65 20 3c 62 3e 75 73 65 ng to the <b>use
16a0: 72 3c 2f 62 3e 20 79 6f 75 27 76 65 20 73 70 65 r</b> you've spe
16b0: 63 69 66 69 65 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c cified.</li>..<l
16c0: 69 3e 69 66 20 74 68 65 20 75 73 65 72 20 6e 61 i>if the user na
16d0: 6d 65 20 61 6e 64 20 74 68 65 20 70 61 73 73 77 me and the passw
16e0: 6f 72 64 20 6d 61 74 63 68 2c 20 61 6e 20 3c 62 ord match, an <b
16f0: 3e 3c 69 3e 53 53 48 20 73 65 73 73 69 6f 6e 3c ><i>SSH session<
1700: 2f 69 3e 3c 2f 62 3e 20 77 69 6c 6c 20 73 74 61 /i></b> will sta
1710: 72 74 2c 20 61 6e 64 20 69 74 20 77 69 6c 6c 20 rt, and it will
1720: 73 75 70 70 6f 72 74 20 74 68 65 20 72 65 71 75 support the requ
1730: 69 72 65 64 20 3c 62 3e 3c 69 3e 53 53 48 20 54 ired <b><i>SSH T
1740: 75 6e 6e 65 6c 3c 2f 69 3e 3c 2f 62 3e 2e 3c 2f unnel</i></b>.</
1750: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 49 6d 70 6f li>..<li><b>Impo
1760: 72 74 61 6e 74 20 6e 6f 74 69 63 65 3c 2f 62 3e rtant notice</b>
1770: 3a 20 64 6f 6e 27 74 20 63 6c 6f 73 65 20 74 68 : don't close th
1780: 65 20 53 68 65 6c 6c 20 77 69 6e 64 6f 77 2c 20 e Shell window,
1790: 62 65 63 61 75 73 65 20 73 75 63 68 20 61 6e 20 because such an
17a0: 61 63 74 69 6f 6e 20 77 69 6c 6c 20 69 6d 6d 65 action will imme
17b0: 64 69 61 74 65 6c 79 20 74 65 72 6d 69 6e 61 74 diately terminat
17c0: 65 20 74 68 65 20 53 53 48 20 54 75 6e 6e 65 6c e the SSH Tunnel
17d0: 2e 3c 62 72 3e 0d 0a 79 6f 75 20 63 6f 75 6c 64 .<br>..you could
17e0: 20 65 76 65 6e 74 75 61 6c 6c 79 20 6d 69 6e 69 eventually mini
17f0: 6d 69 7a 65 20 74 68 65 20 53 68 65 6c 6c 20 77 mize the Shell w
1800: 69 6e 64 6f 77 2c 20 62 75 74 20 6e 65 76 65 72 indow, but never
1810: 20 63 6c 6f 73 65 20 69 74 20 62 65 66 6f 72 65 close it before
1820: 20 74 68 65 20 66 69 6e 61 6c 20 74 65 72 6d 69 the final termi
1830: 6e 61 74 69 6f 6e 20 6f 66 20 79 6f 75 72 20 50 nation of your P
1840: 6f 73 74 67 72 65 53 51 4c 20 63 6f 6e 6e 65 63 ostgreSQL connec
1850: 74 69 6f 6e 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c tion.</li>..</ol
1860: 3e 0d 0a 3c 68 72 3e 0d 0a 3c 68 32 3e 43 6f 6e >..<hr>..<h2>Con
1870: 66 69 67 75 72 69 6e 67 20 50 6f 72 74 20 46 6f figuring Port Fo
1880: 72 77 61 72 64 69 6e 67 20 6f 6e 20 4d 53 20 57 rwarding on MS W
1890: 69 6e 64 6f 77 73 3c 2f 68 32 3e 0d 0a 54 68 65 indows</h2>..The
18a0: 20 6d 6f 73 74 20 72 65 6e 6f 77 6e 65 64 20 53 most renowned S
18b0: 53 48 20 63 6c 69 65 6e 74 20 66 6f 72 20 4d 53 SH client for MS
18c0: 20 57 69 6e 64 6f 77 73 20 28 61 6c 6c 20 76 65 Windows (all ve
18d0: 72 73 69 6f 6e 73 29 20 69 73 20 3c 61 20 68 72 rsions) is <a hr
18e0: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 ef="https://en.w
18f0: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b ikipedia.org/wik
1900: 69 2f 50 75 54 54 59 22 3e 50 75 54 54 59 3c 2f i/PuTTY">PuTTY</
1910: 61 3e 20 28 3c 69 3e 6f 70 65 6e 20 73 6f 75 72 a> (<i>open sour
1920: 63 65 3c 2f 69 3e 29 2e 3c 62 72 3e 0d 0a 49 66 ce</i>).<br>..If
1930: 20 79 6f 75 27 76 65 20 6e 6f 74 20 61 6c 72 65 you've not alre
1940: 61 64 79 20 69 6e 73 74 61 6c 6c 65 64 20 50 75 ady installed Pu
1950: 54 54 59 20 6f 6e 20 79 6f 75 72 20 57 69 6e 64 TTY on your Wind
1960: 6f 77 73 20 62 6f 78 2c 20 79 6f 75 20 63 61 6e ows box, you can
1970: 20 64 6f 77 6e 6c 6f 61 64 20 69 74 20 66 72 6f download it fro
1980: 6d 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 m <a href="https
1990: 3a 2f 2f 77 77 77 2e 63 68 69 61 72 6b 2e 67 72 ://www.chiark.gr
19a0: 65 65 6e 65 6e 64 2e 6f 72 67 2e 75 6b 2f 7e 73 eenend.org.uk/~s
19b0: 67 74 61 74 68 61 6d 2f 70 75 74 74 79 2f 6c 61 gtatham/putty/la
19c0: 74 65 73 74 2e 68 74 6d 6c 22 3e 68 65 72 65 3c test.html">here<
19d0: 2f 61 3e 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a /a>...<br><br>..
19e0: 3c 74 61 62 6c 65 20 63 65 6c 6c 70 61 64 64 69 <table cellpaddi
19f0: 6e 67 3d 22 36 22 20 63 65 6c 6c 73 70 61 63 69 ng="6" cellspaci
1a00: 6e 67 3d 22 36 22 20 62 6f 72 64 65 72 3d 22 31 ng="6" border="1
1a10: 22 20 77 69 64 74 68 3d 22 31 30 30 25 22 3e 0d " width="100%">.
1a20: 0a 3c 74 72 3e 0d 0a 3c 74 64 3e 3c 6f 6c 3e 0d .<tr>..<td><ol>.
1a30: 0a 3c 6c 69 3e 73 74 61 72 74 20 61 20 50 75 54 .<li>start a PuT
1a40: 54 59 20 73 65 73 73 69 6f 6e 3a 20 61 20 64 69 TY session: a di
1a50: 61 6c 6f 67 20 62 6f 78 20 77 69 6c 6c 20 61 70 alog box will ap
1a60: 70 65 61 72 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e pear.</li>..<li>
1a70: 65 6e 74 65 72 20 74 68 65 20 49 50 20 61 64 64 enter the IP add
1a80: 72 65 73 73 20 6f 72 20 74 68 65 20 64 6f 6d 61 ress or the doma
1a90: 69 6e 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 72 in name of the r
1aa0: 65 6d 6f 74 65 20 73 65 72 76 65 72 2e 3c 2f 6c emote server.</l
1ab0: 69 3e 0d 0a 3c 6c 69 3e 74 68 65 6e 20 74 6f 67 i>..<li>then tog
1ac0: 67 6c 65 20 74 68 65 20 3c 62 3e 53 53 48 3c 2f gle the <b>SSH</
1ad0: 62 3e 20 6e 6f 64 65 20 73 6f 20 74 6f 20 66 75 b> node so to fu
1ae0: 6c 6c 79 20 65 78 70 61 6e 64 20 69 74 2e 3c 2f lly expand it.</
1af0: 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 3c 2f 74 64 3e 0d li>..</ol></td>.
1b00: 0a 3c 74 64 3e 3c 69 6d 67 20 73 72 63 3d 22 68 .<td><img src="h
1b10: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
1b20: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 gis.it/gaia-sins
1b30: 2f 70 6f 72 74 2d 66 6f 72 77 61 72 64 69 6e 67 /port-forwarding
1b40: 2d 73 73 68 2d 74 75 6e 6e 65 6c 2f 70 75 74 74 -ssh-tunnel/putt
1b50: 79 2d 31 2e 70 6e 67 22 20 61 6c 74 3d 22 70 75 y-1.png" alt="pu
1b60: 74 74 79 2d 31 22 3e 3c 2f 74 64 3e 0d 0a 3c 2f tty-1"></td>..</
1b70: 74 72 3e 3c 74 72 3e 0d 0a 3c 74 64 3e 3c 6f 6c tr><tr>..<td><ol
1b80: 3e 0d 0a 3c 6c 69 3e 6e 6f 77 20 63 6c 69 63 6b >..<li>now click
1b90: 20 6f 6e 20 74 68 65 20 3c 62 3e 54 75 6e 6e 65 on the <b>Tunne
1ba0: 6c 73 3c 2f 62 3e 20 6e 6f 64 65 3c 2f 6c 69 3e ls</b> node</li>
1bb0: 0d 0a 3c 6c 69 3e 61 20 6e 65 77 20 22 3c 69 3e ..<li>a new "<i>
1bc0: 4f 70 74 69 6f 6e 73 20 63 6f 6e 74 72 6f 6c 6c Options controll
1bd0: 69 6e 67 20 53 53 48 20 70 6f 72 74 20 66 6f 72 ing SSH port for
1be0: 77 61 72 64 69 6e 67 3c 2f 69 3e 22 20 70 61 6e warding</i>" pan
1bf0: 65 20 77 69 6c 6c 20 61 70 70 65 61 72 2e 3c 2f e will appear.</
1c00: 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 3c 2f 74 64 3e 0d li>..</ol></td>.
1c10: 0a 3c 74 64 3e 3c 69 6d 67 20 73 72 63 3d 22 68 .<td><img src="h
1c20: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
1c30: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 gis.it/gaia-sins
1c40: 2f 70 6f 72 74 2d 66 6f 72 77 61 72 64 69 6e 67 /port-forwarding
1c50: 2d 73 73 68 2d 74 75 6e 6e 65 6c 2f 70 75 74 74 -ssh-tunnel/putt
1c60: 79 2d 32 2e 70 6e 67 22 20 61 6c 74 3d 22 70 75 y-2.png" alt="pu
1c70: 74 74 79 2d 32 22 3e 3c 2f 74 64 3e 0d 0a 3c 2f tty-2"></td>..</
1c80: 74 72 3e 3c 74 72 3e 0d 0a 3c 74 64 3e 3c 6f 6c tr><tr>..<td><ol
1c90: 3e 0d 0a 3c 6c 69 3e 65 6e 74 65 72 20 74 68 65 >..<li>enter the
1ca0: 20 73 6f 75 72 63 65 20 61 6e 64 20 64 65 73 74 source and dest
1cb0: 69 6e 61 74 69 6f 6e 20 70 6f 72 74 73 2e 3c 62 ination ports.<b
1cc0: 72 3e 0d 0a 50 61 79 20 63 6c 6f 73 65 20 61 74 r>..Pay close at
1cd0: 74 65 6e 74 69 6f 6e 3a 0d 0a 3c 75 6c 3e 0d 0a tention:..<ul>..
1ce0: 3c 6c 69 3e 74 68 65 20 3c 62 3e 53 6f 75 72 63 <li>the <b>Sourc
1cf0: 65 20 70 6f 72 74 3c 2f 62 3e 20 69 73 20 74 68 e port</b> is th
1d00: 65 20 49 50 20 70 6f 72 74 20 3c 62 3e 6f 6e 20 e IP port <b>on
1d10: 79 6f 75 72 20 6c 6f 63 61 6c 20 6d 61 63 68 69 your local machi
1d20: 6e 65 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c ne</b>.</li>..<l
1d30: 69 3e 61 6e 64 20 74 68 65 20 3c 62 3e 44 65 73 i>and the <b>Des
1d40: 74 69 6e 61 74 69 6f 6e 3c 2f 62 3e 20 69 73 20 tination</b> is
1d50: 74 68 65 20 70 6f 72 74 20 3c 62 3e 6f 6e 20 74 the port <b>on t
1d60: 68 65 20 72 65 6d 6f 74 65 20 73 65 72 76 65 72 he remote server
1d70: 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e </b>.</li>..<li>
1d80: 61 6e 20 53 53 48 20 54 75 6e 6e 65 6c 20 6c 69 an SSH Tunnel li
1d90: 6b 65 20 74 68 69 73 20 77 69 6c 6c 20 66 6f 72 ke this will for
1da0: 77 61 72 64 20 79 6f 75 72 20 6c 6f 63 61 6c 20 ward your local
1db0: 70 6f 72 74 20 35 34 33 32 31 20 64 69 72 65 63 port 54321 direc
1dc0: 74 6c 79 20 74 6f 20 50 6f 73 74 67 72 65 53 51 tly to PostgreSQ
1dd0: 4c 20 6f 6e 20 74 68 65 20 73 65 72 76 65 72 20 L on the server
1de0: 28 70 6f 72 74 20 35 34 33 32 29 2e 3c 2f 6c 69 (port 5432).</li
1df0: 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c >..</ul></li>..<
1e00: 6c 69 3e 74 68 65 6e 20 70 72 65 73 73 20 74 68 li>then press th
1e10: 65 20 3c 62 3e 41 64 64 3c 2f 62 3e 20 62 75 74 e <b>Add</b> but
1e20: 74 6f 6e 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e ton.</li>..</ol>
1e30: 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 3c 69 6d 67 20 </td>..<td><img
1e40: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 src="https://www
1e50: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 .gaia-gis.it/gai
1e60: 61 2d 73 69 6e 73 2f 70 6f 72 74 2d 66 6f 72 77 a-sins/port-forw
1e70: 61 72 64 69 6e 67 2d 73 73 68 2d 74 75 6e 6e 65 arding-ssh-tunne
1e80: 6c 2f 70 75 74 74 79 2d 33 2e 70 6e 67 22 20 61 l/putty-3.png" a
1e90: 6c 74 3d 22 70 75 74 74 79 2d 33 22 3e 3c 2f 74 lt="putty-3"></t
1ea0: 64 3e 0d 0a 3c 2f 74 72 3e 3c 74 72 3e 0d 0a 3c d>..</tr><tr>..<
1eb0: 74 64 3e 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 6a 75 73 td><ol>..<li>jus
1ec0: 74 20 61 20 66 69 6e 61 6c 20 63 68 65 63 6b 20 t a final check
1ed0: 73 6f 20 74 6f 20 76 65 72 69 66 79 20 69 66 20 so to verify if
1ee0: 74 68 65 20 70 6f 72 74 20 66 6f 72 77 61 72 64 the port forward
1ef0: 69 6e 67 20 63 6f 6e 66 69 67 75 72 61 74 69 6f ing configuratio
1f00: 6e 20 69 73 20 63 6f 72 72 65 63 74 2e 3c 2f 6c n is correct.</l
1f10: 69 3e 0d 0a 3c 6c 69 3e 61 6e 64 20 66 69 6e 61 i>..<li>and fina
1f20: 6c 6c 79 20 70 72 65 73 73 20 74 68 65 20 3c 62 lly press the <b
1f30: 3e 4f 70 65 6e 3c 2f 62 3e 20 62 75 74 74 6f 6e >Open</b> button
1f40: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 3c 2f 74 .</li>..</ol></t
1f50: 64 3e 0d 0a 3c 74 64 3e 3c 69 6d 67 20 73 72 63 d>..<td><img src
1f60: 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 ="https://www.ga
1f70: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 ia-gis.it/gaia-s
1f80: 69 6e 73 2f 70 6f 72 74 2d 66 6f 72 77 61 72 64 ins/port-forward
1f90: 69 6e 67 2d 73 73 68 2d 74 75 6e 6e 65 6c 2f 70 ing-ssh-tunnel/p
1fa0: 75 74 74 79 2d 34 2e 70 6e 67 22 20 61 6c 74 3d utty-4.png" alt=
1fb0: 22 70 75 74 74 79 2d 34 22 3e 3c 2f 74 64 3e 0d "putty-4"></td>.
1fc0: 0a 3c 2f 74 72 3e 3c 74 72 3e 0d 0a 3c 74 64 3e .</tr><tr>..<td>
1fd0: 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 64 69 <ol>..<li>the di
1fe0: 61 6c 6f 67 20 62 6f 78 20 77 69 6c 6c 20 64 69 alog box will di
1ff0: 73 61 70 70 65 61 72 2c 20 61 6e 64 20 77 69 6c sappear, and wil
2000: 6c 20 62 65 20 72 65 70 6c 61 63 65 64 20 62 79 l be replaced by
2010: 20 61 20 50 75 54 54 59 20 53 68 65 6c 6c 20 77 a PuTTY Shell w
2020: 69 6e 64 6f 77 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 indow.</li>..<li
2030: 3e 69 6e 73 65 72 74 20 79 6f 75 72 20 3c 62 3e >insert your <b>
2040: 75 73 65 72 20 6e 61 6d 65 3c 2f 62 3e 20 61 6e user name</b> an
2050: 64 20 3c 62 3e 70 61 73 73 77 6f 72 64 3c 2f 62 d <b>password</b
2060: 3e 20 77 68 65 6e 20 72 65 71 75 69 72 65 64 2e > when required.
2070: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 66 20 74 68 </li>..<li>if th
2080: 65 20 75 73 65 72 20 6e 61 6d 65 20 61 6e 64 20 e user name and
2090: 74 68 65 20 70 61 73 73 77 6f 72 64 20 6d 61 74 the password mat
20a0: 63 68 2c 20 61 6e 20 53 53 48 20 73 65 73 73 69 ch, an SSH sessi
20b0: 6f 6e 20 77 69 6c 6c 20 73 74 61 72 74 2c 20 61 on will start, a
20c0: 6e 64 20 69 74 20 77 69 6c 6c 20 73 75 70 70 6f nd it will suppo
20d0: 72 74 20 74 68 65 20 72 65 71 75 69 72 65 64 20 rt the required
20e0: 3c 62 3e 53 53 48 20 54 75 6e 6e 65 6c 3c 2f 62 <b>SSH Tunnel</b
20f0: 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 79 6f 75 >.</li>..<li>you
2100: 20 61 72 65 20 6e 6f 77 20 61 62 6c 65 20 74 6f are now able to
2110: 20 63 6f 6e 6e 65 63 74 20 61 6e 79 20 50 6f 73 connect any Pos
2120: 74 67 72 65 53 51 4c 20 63 6c 69 65 6e 74 20 74 tgreSQL client t
2130: 6f 20 74 68 65 20 6c 6f 63 61 6c 20 70 6f 72 74 o the local port
2140: 20 31 32 33 34 35 20 61 6e 64 20 61 20 63 6f 6e 12345 and a con
2150: 6e 65 63 74 69 6f 6e 20 74 6f 20 74 68 65 20 72 nection to the r
2160: 65 6d 6f 74 65 20 50 6f 73 74 67 72 65 53 51 4c emote PostgreSQL
2170: 20 77 69 6c 6c 20 62 65 20 3c 62 3e 3c 69 3e 6d will be <b><i>m
2180: 61 67 69 63 61 6c 6c 79 3c 2f 69 3e 3c 2f 62 3e agically</i></b>
2190: 20 65 73 74 61 62 6c 69 73 68 65 64 2e 3c 2f 6c established.</l
21a0: 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 49 6d 70 6f 72 i>..<li><b>Impor
21b0: 74 61 6e 74 20 6e 6f 74 69 63 65 3c 2f 62 3e 3a tant notice</b>:
21c0: 20 64 6f 6e 27 74 20 63 6c 6f 73 65 20 74 68 65 don't close the
21d0: 20 50 75 54 54 59 20 53 68 65 6c 6c 20 77 69 6e PuTTY Shell win
21e0: 64 6f 77 2c 20 62 65 63 61 75 73 65 20 73 75 63 dow, because suc
21f0: 68 20 61 6e 20 61 63 74 69 6f 6e 20 77 69 6c 6c h an action will
2200: 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 74 65 72 immediately ter
2210: 6d 69 6e 61 74 65 20 74 68 65 20 53 53 48 20 54 minate the SSH T
2220: 75 6e 6e 65 6c 2e 3c 62 72 3e 0d 0a 79 6f 75 20 unnel.<br>..you
2230: 63 6f 75 6c 64 20 65 76 65 6e 74 75 61 6c 6c 79 could eventually
2240: 20 6d 69 6e 69 6d 69 7a 65 20 74 68 65 20 50 75 minimize the Pu
2250: 54 54 59 20 53 68 65 6c 6c 20 77 69 6e 64 6f 77 TTY Shell window
2260: 2c 20 62 75 74 20 6e 65 76 65 72 20 63 6c 6f 73 , but never clos
2270: 65 20 69 74 20 62 65 66 6f 72 65 20 74 68 65 20 e it before the
2280: 66 69 6e 61 6c 20 74 65 72 6d 69 6e 61 74 69 6f final terminatio
2290: 6e 20 6f 66 20 79 6f 75 72 20 50 6f 73 74 67 72 n of your Postgr
22a0: 65 53 51 4c 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e eSQL connection.
22b0: 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 3c 2f 74 64 </li>..</ol></td
22c0: 3e 0d 0a 3c 74 64 3e 3c 69 6d 67 20 73 72 63 3d >..<td><img src=
22d0: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 "https://www.gai
22e0: 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 a-gis.it/gaia-si
22f0: 6e 73 2f 70 6f 72 74 2d 66 6f 72 77 61 72 64 69 ns/port-forwardi
2300: 6e 67 2d 73 73 68 2d 74 75 6e 6e 65 6c 2f 70 75 ng-ssh-tunnel/pu
2310: 74 74 79 2d 73 68 65 6c 6c 2e 70 6e 67 22 20 61 tty-shell.png" a
2320: 6c 74 3d 22 70 75 74 74 79 2d 73 68 65 6c 6c 22 lt="putty-shell"
2330: 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c ></td>..</tr>..<
2340: 2f 74 61 62 6c 65 3e 0d 0a 3c 62 72 3e 0d 0a 3c /table>..<br>..<
2350: 68 72 3e 0d 0a 3c 62 72 3e 0d 0a 42 61 63 6b 20 hr>..<br>..Back
2360: 74 6f 20 74 68 65 20 3c 62 3e 56 69 72 74 75 61 to the <b>Virtua
2370: 6c 50 47 3c 2f 62 3e 20 3c 61 20 68 72 65 66 3d lPG</b> <a href=
2380: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 "https://www.gai
2390: 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f a-gis.it/fossil/
23a0: 76 69 72 74 75 61 6c 70 67 2f 77 69 6b 69 3f 6e virtualpg/wiki?n
23b0: 61 6d 65 3d 74 75 74 6f 72 69 61 6c 22 3e 74 75 ame=tutorial">tu
23c0: 74 6f 72 69 61 6c 3c 2f 61 3e 0a 5a 20 66 31 65 torial</a>.Z f1e
23d0: 61 31 36 64 39 34 66 37 66 62 30 30 65 62 38 36 a16d94f7fb00eb86
23e0: 66 35 31 33 34 65 33 63 34 36 30 63 36 0a f5134e3c460c6.