<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Port Forwarding &amp; Tunneling on LEIKAH</title><link>https://leikah.haoyingcao.xyz/en/docs/tunneling/</link><description>Recent content in Port Forwarding &amp; Tunneling on LEIKAH</description><generator>Hugo</generator><language>en</language><atom:link href="https://leikah.haoyingcao.xyz/en/docs/tunneling/index.xml" rel="self" type="application/rss+xml"/><item><title>Port Forwarding with SSH</title><link>https://leikah.haoyingcao.xyz/en/docs/tunneling/ssh_port_forward/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://leikah.haoyingcao.xyz/en/docs/tunneling/ssh_port_forward/</guid><description>&lt;h2 id="what-is-port-forwarding"&gt;What is port forwarding?&lt;a class="td-heading-self-link" href="#what-is-port-forwarding" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Port forwarding is a technique that allows communication requests to be redirected from one port to another. This can be for ports on the same machine, or different machines on the same network.&lt;/p&gt;
&lt;p&gt;SSH, in addition to providing secure remote shell for management, also provides secure port forwarding tunnel connections. It can be used to create three types of port forwarding:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Local&lt;/strong&gt;: Forward one specified port the pivot host has access to one local port of the local host, as if a remote service is running directly on the local host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamic&lt;/strong&gt;: Create SOCKS proxy on local host, and route all traffic to a specific network through the pivot host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reverse&lt;/strong&gt;: Forward one specified port on the local machine to the pivot host, allowing machines on an internal network access a service on the local machine through the pivot host.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="local-port-forwarding"&gt;Local Port Forwarding&lt;a class="td-heading-self-link" href="#local-port-forwarding" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Suppose we have access to a web server via SSH that is also running a MySQL database server on &lt;code&gt;localhost:3306&lt;/code&gt;. We can leverage our SSH access to have it create a listener on our local machine (port 1234/TCP), which forwards traffic to the SSH server, which then forwards the traffic to &lt;code&gt;localhost:3306&lt;/code&gt; of the web server. We can then communicate to thislistener as if we are communicating to the MySQL server directly.&lt;/p&gt;</description></item></channel></rss>