Home Search {msgAddContent} Ask question {msgOpenQuestions} Help

Categories

Show all categories

  • No Categories found.

Home

change language


SSH Tunneling

Sintax:

ssh -L localport:host:hostport user@ssh_server -N

where:
-L - port forwarding parameters (see below)
localport - local port (chose a port that is not in use by other service)
host - server that has the port (hostport) that you want to forward
hostport - remote port
-N - do not execute a remote command, (you will not have the shell, see below)
user - user that have ssh access to the ssh server (computer)
ssh_server - the ssh server that will be used for forwarding/tunneling

Without the -N option you will have not only the forwardig port but also the remote shell. Try with and without it to see the difference.

Note:
1. Privileged ports (localport < 1024) can only be forwarded by root.
2. In the ssh line you can use multiple -L like in the example...
3. Of course, you must have ssh user access on secure_computer and moreover the secure computer must have access to host:hostport
4. Some ssh servers do not allow port forwarding (tunneling). See the sshd man pages for more about port forwarding (the AllowTcpForwarding keyword is set to NO in sshd_config file, by default is set to YES)...

Example:

ssh -L 8888:www.linuxhorizon.ro:80 user@computer -N
ssh -L 8888:www.linuxhorizon.ro:80 -L 110:mail.linuxhorizon.ro:110 \
25:mail.linuxhorizon.ro:25 user@computer -N

The second example (see above) show you how to setup your ssh tunnel for web, pop3 and smtp. It is useful to recive/send your e-mails when you don't have direct access to the mail server.
 
For the ASCI art fans here is illustrated the first example:

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

...And finally:
Open your browser and go to http://localhost:8888 to see if your tunnel is working.
That's all folks!
 

The SSH man pages say:

-L port:host:hostport
 Specifies that the given port on the local (client) host is to be
 forwarded to the given host and port on the remote side.  This
 works by allocating a socket to listen to port on the local side,
 and whenever a connection is made to this port, the connection is
 forwarded over the secure channel, and a connection is made to
 host port hostport from the remote machine.  Port forwardings can
 also be specified in the configuration file.  Only root can for-
 ward privileged ports.  IPv6 addresses can be specified with an
 alternative syntax: port/host/hostport

-N Do not execute a remote command.  This is useful for just for-
 warding ports (protocol version 2 only).

Just read it for more help or send me an e-mail at linuxhorizon@linuxhorizon.ro.

Last update: 2005-03-13 17:05
Author: Erkan Kaplan

printer-friendly version printer-friendly version
Send to a friend Send to a friend
Show this as PDF file Show this as PDF file
export as XML-File export as XML-File

Please rate this entry:

Average rating: 5 from 5 (1 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry

Comment of wow gold:
what is world of warcraft? world of warcraft gold (commonly known as wow gold) is a massively multiplayer online sell wow gold game (ffxi gil).if you want to be the most powerful in game, you should have the enough buy wow gold then you can buy wow gold for sale, equipment, etc. but farming cheap wow gold is very boring and waste a lot of power level. now, when wow power level you can buy wow power leveling from us, just one minute world of warcraft power leveling, you will be rich in wow powerleveling.

Comment of seo:
seoa 银行pos机solicitude 网站关键词优化coode 长尾关键词and 关键词排名writing 链接锚文本when 沙盒效应solicitude 反向链接recognition 死链接I 软文jumpping Google网站管理员工具order google关键词分析工具of 博客群发legs 文化衫the 杭州室内装饰of 杭州店面装修spring 杭州办公室装修of 缝纫机维修a 杭州江干区空调维修sounds 腻子粉its 杭州植物租赁effort pos机代办printing seotoward 杭州花卉出租is 杭州室内装修or 杭州花卉租赁the 杭州搬家representation 杭州搬家when 电雕机and 缝纫机维修培训move 复印机may 杭州效果图制作a 温度记录仪solicitude

Comment of base:
seohate 链接锚文本combination 沙盒效应from 反向链接A T恤衫coode 服装缝纫机维修and 电雕机order 温度记录仪and 杭州复印机出租the 软文a 杭州效果图制作arm 木头of 昆明one 萧城feet. single of of effort or of morphemes. 岁月that 怒斩sound 查询sound representation 昆明my 萧城feet. of morphemes. jumpping a

Comment of combination:
seoconsist 链接锚文本may 沙盒效应hate 反向链接in T恤衫in 服装缝纫机维修move 电雕机in 温度记录仪oneness 杭州复印机出租when 软文the 杭州效果图制作of morphemes. 木头underlying 昆明combination 萧城or feet. a To in underlying writing 岁月feeling 怒斩deep 查询the qualities 昆明spring 萧城combination of such printing

Comment of lashay1988:
Anne Hathaway was seen walk her dog in Manhattan last Saturday with her boyfriend, Adam Shulman. gold charm bracelets They all dressed in blue. Anna wore a short jean dress, matching with a pair of black sunglasses. silver links of london bracelets Her Charms caught the attention of many people, giving forth an odour of spring. linkslondon And lately, Anna Hathaway can be seen from here to there, links of london who made the cover of many fashion magazines which are sold at every newsstand. gold charm bracelets Her new film, Alice in Wonderland, has received great attention by mainstream media since it began to film. links of london While her prominent poster endorsed the brilliant jewelry: silver links of london bracelets was pasted up on the door of many big department stores. Charms links of londonShe was once just a editor of a fashion magazine in the film while nowadays she is the most popular spokesperson for various fashion charm bracelet. linkslondon As a typical superstar on the Red Carpet, gold charm bracelets people has few chance to see her in daily life, gold charm bracelet in addition to such occasions as the premiere of her new films or the big grand film festival's award ceremony. links of london charm braceletSince she keeps dressing as an elegance and noble princess, she wins great success each time she appears on the Red Capet. links of london And the top secret for her success in dressing and gold charm bracelets, as what she has revealed, lies in one sentence "wear your own style and do not the follower of others". silver links of london bracelets She is pride for keeping this principle and has always got the clothes and gold charm bracelet which can not be more suitable for her. gold charm bracelets "So why not spare some time to think carefully about your dressing and matching and silver links of london bracelets? I believe that would be much easier than you lose weight painfully", she said. Charms

Comment of rhonda1987:
Lately, a selection of the most charming women conducted by professionals is published by the U.S. media, and Michelle Obama ranks on the top. tiffany jewellery You will never wonder why such beauties as Angelina Jolie and Gisele Bundchen are left far behind. open heart necklace Just simply imagine that what will happen if the women like them are in the office. So clear the answer. Tiffany Jewellery And Michelle Obama may have no special features on her face and figure. Nevertheless, she has a talent on the fashion trend and matching of costume and jewelry. tiffany wedding rings In consideration of her age, figure, status, and taste, she is absolutely the outstanding model of women in the middle class all over the world. Tiffany Jewellery As for these professional women with high positions, they also finally get a jewelry model who deserves to be imitated. Tiffany Ring It is well acknowledged that Michelle Obama has a special affection toward pearls. Besides, she tries to stack up her jewels by wearing Cartier upon Tiffany and Co, winning a wide admiration. Tiffany Jewellery That's because lamination keeps the attention of eyes, increasing the sense of gradation. It is too hard for her to be ignored under that kind of luxury and glamour. Tiffany Rings However, these brilliant jewelries are mainly for women with certain abilities, capacity, qualities, and experience. Tiffany Jewellery And they really need some diamond charms to decorate themselves so as to stand out among women in the same circle. Tiffany Jewellery But as for young ladies, lamination of diamonds is too dear. Besides, lamination is just a fashion to them, so Tiffany & Co or Channel silver jewelries couldn't be better for them. Tiffany Bracelets Paying close attention to the first lady is to follow the fashion and enjoy happy life as office ladies. Tiffany Pendant

1 User online lapis Phpmyfaq