<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.theeggeadventure.com/wikimedia/index.php?action=history&amp;feed=atom&amp;title=Netcat_tunnel</id>
	<title>Netcat tunnel - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.theeggeadventure.com/wikimedia/index.php?action=history&amp;feed=atom&amp;title=Netcat_tunnel"/>
	<link rel="alternate" type="text/html" href="https://www.theeggeadventure.com/wikimedia/index.php?title=Netcat_tunnel&amp;action=history"/>
	<updated>2026-05-13T10:35:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0-beta</generator>
	<entry>
		<id>https://www.theeggeadventure.com/wikimedia/index.php?title=Netcat_tunnel&amp;diff=2194&amp;oldid=prev</id>
		<title>Brianegge: Created page with &#039;If your sshd config disallows listening to remote ports, you can accomplish about the same thing using nc and ssh.    Typical error message when remote listening is disallowed: &lt;…&#039;</title>
		<link rel="alternate" type="text/html" href="https://www.theeggeadventure.com/wikimedia/index.php?title=Netcat_tunnel&amp;diff=2194&amp;oldid=prev"/>
		<updated>2009-08-27T03:55:11Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;If your sshd config disallows listening to remote ports, you can accomplish about the same thing using nc and ssh.    Typical error message when remote listening is disallowed: &amp;lt;…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;If your sshd config disallows listening to remote ports, you can accomplish about the same thing using nc and ssh.  &lt;br /&gt;
&lt;br /&gt;
Typical error message when remote listening is disallowed:&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ssh -R 18080:thirdhost:8080 remotehost cat -&lt;br /&gt;
Warning: remote port forwarding failed for listen port 18080&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To work around this, you can use netcat and mkfifo to create a tunnel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfifo x&lt;br /&gt;
while true; do ssh remotehost nc -l -p 8081 -c &amp;lt;x | nc -c thirdhost 8081 &amp;gt;x; done&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then on the remote host, you can access the third host via the local tunnel.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately, this approach is limited to a single connection at a time, and also, there is a slight delay after each socket is closed. Another issue is that it&amp;#039;s easy to leave orphan processes on the remote host.&lt;br /&gt;
&lt;br /&gt;
[[Category:Unix]]&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Brianegge</name></author>
	</entry>
</feed>