<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: Netcat &#8211; a couple of useful examples</title>
	<atom:link href="http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/</link>
	<description>An open-source software and technology related journal</description>
	<lastBuildDate>Sun, 28 Feb 2010 05:55:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Robbert Hamburg</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-7086</link>
		<dc:creator>Robbert Hamburg</dc:creator>
		<pubDate>Fri, 02 Mar 2007 11:47:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-7086</guid>
		<description>Hmm that comment of gary was very usefull to me !

Thanks !</description>
		<content:encoded><![CDATA[<p>Hmm that comment of gary was very usefull to me !</p>
<p>Thanks !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5467</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Fri, 05 Jan 2007 15:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5467</guid>
		<description>The main drawback of netcat is that it needs to be started on both sides of the wire to make a transfer work. What I usually do is this:

tar cz /etc &#124; ssh user@host -c &#039;cd /bak ; cat &gt; etc.tgz&#039;

On the localhost, this will create an archive of /etc, which is piped into an ssh connection. On the remote host, the snippet enclosed in &#039;&#039; is executed: Change to the backup directory, and pipe the content of the connection into a file. If I wanted to extract the files again on the receiving side, I could do:

tar cz /etc &#124; ssh user@host -c &#039;cd /bak ; cat tar xz&#039;

Note that the &#039;-f -&#039; given in the article is redundant. If tar is not given a file, it uses STDIN/OUT. The advantage over recursive scp is that this method preserves device nodes and file permissions. The advantage over rsync is that it is using familiar tar semantics on both sides (of course, if you want diffing, you need rsync, which works just fine over SSH).

Of course, the other direction (pulling files from a host) is equally possible:

ssh user@host -c &#039;tar cz /etc&#039; &gt; /bak/etc.tgz</description>
		<content:encoded><![CDATA[<p>The main drawback of netcat is that it needs to be started on both sides of the wire to make a transfer work. What I usually do is this:</p>
<p>tar cz /etc | ssh user@host -c &#8216;cd /bak ; cat &gt; etc.tgz&#8217;</p>
<p>On the localhost, this will create an archive of /etc, which is piped into an ssh connection. On the remote host, the snippet enclosed in &#8221; is executed: Change to the backup directory, and pipe the content of the connection into a file. If I wanted to extract the files again on the receiving side, I could do:</p>
<p>tar cz /etc | ssh user@host -c &#8216;cd /bak ; cat tar xz&#8217;</p>
<p>Note that the &#8216;-f -&#8217; given in the article is redundant. If tar is not given a file, it uses STDIN/OUT. The advantage over recursive scp is that this method preserves device nodes and file permissions. The advantage over rsync is that it is using familiar tar semantics on both sides (of course, if you want diffing, you need rsync, which works just fine over SSH).</p>
<p>Of course, the other direction (pulling files from a host) is equally possible:</p>
<p>ssh user@host -c &#8216;tar cz /etc&#8217; &gt; /bak/etc.tgz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cucirca</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5453</link>
		<dc:creator>Cucirca</dc:creator>
		<pubDate>Thu, 04 Jan 2007 16:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5453</guid>
		<description>Thanks for this useful commands ;)</description>
		<content:encoded><![CDATA[<p>Thanks for this useful commands ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GNot</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5123</link>
		<dc:creator>GNot</dc:creator>
		<pubDate>Mon, 27 Nov 2006 09:21:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5123</guid>
		<description>Thanks. There are indeed many ways to use netcat effectively. Very interesting.
</description>
		<content:encoded><![CDATA[<p>Thanks. There are indeed many ways to use netcat effectively. Very interesting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Traveller</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5114</link>
		<dc:creator>Traveller</dc:creator>
		<pubDate>Sat, 25 Nov 2006 10:38:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5114</guid>
		<description>One handy use of netcat I didn&#039;t see mentioned is a fast way to get an bit-for-bit image copy of a working machine&#039;s root partition onto another machine.

Boot source and destination off live CD&#039;s, make sure source and destination partitions are similar in size with cfdisk and then pipe directly from the source machine&#039;s partition to the destination machine&#039;s partition via netcat. When copy is complete mount the destination partition and tweak IP address, hostname and /etc/iftab. Reboot. You should now have a duplicate working machine.

Booting off the live CD&#039;s insures that there are no open files in source and destination partition and provides tools for adjusting partition sizes etc. In addition since the partition contents are copied directly no intermediate storage is required.</description>
		<content:encoded><![CDATA[<p>One handy use of netcat I didn&#8217;t see mentioned is a fast way to get an bit-for-bit image copy of a working machine&#8217;s root partition onto another machine.</p>
<p>Boot source and destination off live CD&#8217;s, make sure source and destination partitions are similar in size with cfdisk and then pipe directly from the source machine&#8217;s partition to the destination machine&#8217;s partition via netcat. When copy is complete mount the destination partition and tweak IP address, hostname and /etc/iftab. Reboot. You should now have a duplicate working machine.</p>
<p>Booting off the live CD&#8217;s insures that there are no open files in source and destination partition and provides tools for adjusting partition sizes etc. In addition since the partition contents are copied directly no intermediate storage is required.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5074</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Thu, 16 Nov 2006 18:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5074</guid>
		<description>Here is a fine &lt;a href=&quot;http://www.debian-administration.org/articles/145&quot; rel=&quot;nofollow&quot;&gt;tutorial&lt;/a&gt; on using netcat to pipe audio over a lan.</description>
		<content:encoded><![CDATA[<p>Here is a fine <a href="http://www.debian-administration.org/articles/145" rel="nofollow">tutorial</a> on using netcat to pipe audio over a lan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GNot</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5055</link>
		<dc:creator>GNot</dc:creator>
		<pubDate>Fri, 10 Nov 2006 07:35:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5055</guid>
		<description>Thanks for providing an example. CLI option syntax may vary from distribution to distribution. It seems that this syntax difference when setting the listening port is one of the major differences.
</description>
		<content:encoded><![CDATA[<p>Thanks for providing an example. CLI option syntax may vary from distribution to distribution. It seems that this syntax difference when setting the listening port is one of the major differences.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DP</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5047</link>
		<dc:creator>DP</dc:creator>
		<pubDate>Thu, 09 Nov 2006 17:23:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5047</guid>
		<description>This article is excellent. 

When I tried to listen, I faced some problem. Because in my system, command syntax is different. I have to use netcat -l -p 3333 in my system.</description>
		<content:encoded><![CDATA[<p>This article is excellent. </p>
<p>When I tried to listen, I faced some problem. Because in my system, command syntax is different. I have to use netcat -l -p 3333 in my system.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GNot</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5045</link>
		<dc:creator>GNot</dc:creator>
		<pubDate>Wed, 08 Nov 2006 06:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5045</guid>
		<description>Exactly. The same functionality can be achieved with other tools and protocols like FTP, SSH, RSync etc. As I have written above, netcat is not a necessary tool in the everyday use, but its primitive functionality could be useful in a particular occasion.

Using scp is my method of choice in order to transfer files between networked computers. I just wanted to show how to transfer files using netcat through an SSH tunnel. That&#039;s all :)

Thanks for your comment.</description>
		<content:encoded><![CDATA[<p>Exactly. The same functionality can be achieved with other tools and protocols like FTP, SSH, RSync etc. As I have written above, netcat is not a necessary tool in the everyday use, but its primitive functionality could be useful in a particular occasion.</p>
<p>Using scp is my method of choice in order to transfer files between networked computers. I just wanted to show how to transfer files using netcat through an SSH tunnel. That&#8217;s all :)</p>
<p>Thanks for your comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anjan bacchu</title>
		<link>http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5042</link>
		<dc:creator>anjan bacchu</dc:creator>
		<pubDate>Tue, 07 Nov 2006 21:33:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/#comment-5042</guid>
		<description>hi there,

  nice article.

question : if one already has left the SSH port open, we can as well use scp to get the file. If so, why would we want to use netcat on top of that ?

BR,
~A</description>
		<content:encoded><![CDATA[<p>hi there,</p>
<p>  nice article.</p>
<p>question : if one already has left the SSH port open, we can as well use scp to get the file. If so, why would we want to use netcat on top of that ?</p>
<p>BR,<br />
~A</p>
]]></content:encoded>
	</item>
</channel>
</rss>
