<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Admin Zone &#187; port forwarding</title>
	<atom:link href="http://linuxadminzone.com/tag/port-forwarding/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxadminzone.com</link>
	<description>Adding more reasons to celebrate Open Source.</description>
	<lastBuildDate>Wed, 09 May 2012 10:17:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>SSH Port forwarding from remote to local machine</title>
		<link>http://linuxadminzone.com/ssh-port-forwarding-from-remote-to-local-machine/</link>
		<comments>http://linuxadminzone.com/ssh-port-forwarding-from-remote-to-local-machine/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 07:32:44 +0000</pubDate>
		<dc:creator>jagbir</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[port forwarding]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://linuxadminzone.com/?p=19</guid>
		<description><![CDATA[SSH has a wonderful feature called SSH Port Forwarding, also known as SSH Tunneling, which allows you to establish a secure SSH session and then tunnel arbitrary TCP connections through it. Tunnels can be created at any time, with almost no effort and no programming, which makes them very appealing. Here I&#8217;ll illustrate it using [...]]]></description>
			<content:encoded><![CDATA[<p>SSH has a wonderful feature called SSH Port Forwarding, also known as SSH Tunneling, which allows you to establish a secure SSH session and then tunnel arbitrary TCP connections through it. Tunnels can be created at any time, with almost no effort and no programming, which makes them very appealing.</p>
<p>Here I&#8217;ll illustrate it using an example. Suppose you have installed and configured Jabber Instant Messaging Server (check out to do that on this site <a href="http://linuxadminzone.com/install-and-configure-ejabberd-jabber-im-server/">here</a>). You found later that in the Server machine, there&#8217;s no GUI available and you need to access its graphical web admin interface. In this case, you can easily forward port from Server machine to your own PC to access the admin interface. You might know that ejabberd (Jabber Server) web admin interface is available on port 5280. </p>
<p>Just for checking, try once to telnet to port 5280 on locahost:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>Desktop<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># telnet localhost 5280</span>
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused</pre></div></div>

<p>The connection was refused as there&#8217;s no service to entertain the request on specified port. </p>
<p>Let&#8217;s do the forwarding now. The syntax is: ssh -L <em>localport:remotehost:remoteport remotehostip</em></p>
<p>Here is the example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>Desktop<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ssh -L 5280:localhost:5280 192.168.0.38</span>
Password: <span style="color: #000000; font-weight: bold;">******</span></pre></div></div>

<p>It should come to remote server shell, leave it as is. </p>
<p>You will be logged in Server and the specified port will be forwarded to your host. Sometimes, its uncomfortable to login in the Server while we just need to do only port forwarding, you can avoid logging in Server by using -N option with ssh command.</p>
<p>Just jump to another another shell and try to telnet localhost now:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>Desktop<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># telnet localhost 5280</span>
Trying 127.0.0.1...
Connected to localhost.localdomain <span style="color: #7a0874; font-weight: bold;">&#40;</span>127.0.0.1<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
Escape character is <span style="color: #ff0000;">'^]'</span>.</pre></div></div>

<p>Cool. you are able to connect. Open your browser and type: http://localhost:5280/admin/ to open the web admin interface of ejabberd IM Server.</p>
<p>You may also like to read:<br />
* <a href="http://linuxadminzone.com/5-steps-to-secure-your-linux-server/"> 5 steps to secure your Linux Server </a><br />
* <a href="http://linuxadminzone.com/ensuring-secure-access-to-production-linux-servers/"> Ensuring secure access to production Linux Servers </a><br />
* <a href="http://linuxadminzone.com/bash-script-to-backup-essential-log-files-of-linux-server/"> Bash script to backup essential log files in Linux </a><br />
* <a href="http://linuxadminzone.com/quickly-change-your-ssh-port-from-default-22-to-something-higher/"> Quickly change your ssh port from defualt 22 to something higher </a><br />
* <a href="http://linuxadminzone.com/ssh-port-forwarding-from-remote-to-local-machine/"> SSH port forwarding from remote to local machine </a><br />
* <a href="http://linuxadminzone.com/save-root-or-user-history-to-check-later/"> Save root or user history to check later </a><br />
* <a href="http://linuxadminzone.com/install-and-configure-denyhost/"> Install and configure denyhost to prevent brute force attacks </a></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxadminzone.com/ssh-port-forwarding-from-remote-to-local-machine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

