<?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/"
		>
<channel>
	<title>Comments on: PHP SSH2 code</title>
	<atom:link href="http://blog.apokalyptik.com/2010/08/27/php-ssh2-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.apokalyptik.com/2010/08/27/php-ssh2-code/</link>
	<description>The random things that spew forth from my brain...</description>
	<lastBuildDate>Fri, 25 Jan 2013 23:59:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6-beta2-24222</generator>
	<item>
		<title>By: apokalyptik</title>
		<link>http://blog.apokalyptik.com/2010/08/27/php-ssh2-code/comment-page-1/#comment-9175</link>
		<dc:creator>apokalyptik</dc:creator>
		<pubDate>Sun, 05 Sep 2010 17:58:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=659#comment-9175</guid>
		<description><![CDATA[This is just meant to be some helpful started code for a cog in a bigger application so how you wanted to go about the rest of implementation really depends on what you&#039;re doing.  Probably the simplest thing would be to read the user/pass from STDIN, and keep trying an mt_rand(min,max) port possibly on multiple localhost addresses (did you know you can bind lots of 127 ip addresses to lo?) and communicate the found ip/port on STDOUT before firing up the loop.  This way your controlling process could write/read relevant information from proc_open() pipes.  There of course are lots of other things you could do depending on your needs.  I would avoid using an IPC socket pair except maybe as a heartbeat monitor to make sure the controlling process hasn&#039;t gone away (but even that is dependent on how you&#039;re using the thing.)  Also I&#039;ve documented how to use password authentication with the SSH command in another post on this blog which you might be interested in reading. ]]></description>
		<content:encoded><![CDATA[<p>This is just meant to be some helpful started code for a cog in a bigger application so how you wanted to go about the rest of implementation really depends on what you&#039;re doing.  Probably the simplest thing would be to read the user/pass from STDIN, and keep trying an mt_rand(min,max) port possibly on multiple localhost addresses (did you know you can bind lots of 127 ip addresses to lo?) and communicate the found ip/port on STDOUT before firing up the loop.  This way your controlling process could write/read relevant information from proc_open() pipes.  There of course are lots of other things you could do depending on your needs.  I would avoid using an IPC socket pair except maybe as a heartbeat monitor to make sure the controlling process hasn&#039;t gone away (but even that is dependent on how you&#039;re using the thing.)  Also I&#039;ve documented how to use password authentication with the SSH command in another post on this blog which you might be interested in reading. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alfred Armstrong</title>
		<link>http://blog.apokalyptik.com/2010/08/27/php-ssh2-code/comment-page-1/#comment-9170</link>
		<dc:creator>Alfred Armstrong</dc:creator>
		<pubDate>Sun, 05 Sep 2010 09:15:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=659#comment-9170</guid>
		<description><![CDATA[One thing: since the tunnel script once created just sits there waiting, it can&#039;t be used except as a background task of some kind. So are you running it via the commandline, or forking a process from PHP?  
 
If the former I guess it&#039;s an improvement on the ssh command because you can get passwords etc from a database and that makes life easier, but there&#039;s still a potential issue with managing the allocation of ports, isn&#039;t there? Are you using some kind of IPC so your PHP components all know what&#039;s going on? ]]></description>
		<content:encoded><![CDATA[<p>One thing: since the tunnel script once created just sits there waiting, it can&#039;t be used except as a background task of some kind. So are you running it via the commandline, or forking a process from PHP? </p>
<p>If the former I guess it&#039;s an improvement on the ssh command because you can get passwords etc from a database and that makes life easier, but there&#039;s still a potential issue with managing the allocation of ports, isn&#039;t there? Are you using some kind of IPC so your PHP components all know what&#039;s going on? </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: apokalyptik</title>
		<link>http://blog.apokalyptik.com/2010/08/27/php-ssh2-code/comment-page-1/#comment-9156</link>
		<dc:creator>apokalyptik</dc:creator>
		<pubDate>Fri, 03 Sep 2010 07:31:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=659#comment-9156</guid>
		<description><![CDATA[Glad it helped!  And yes on both counts -- the lack of useful examples is frustrating AND it would be nice to be able to tell mysql_p?connect() to use it like that.  Actually what would be the most useful to most people would be to have ssh2_socket_create_pair() a la socket_create_pair() ]]></description>
		<content:encoded><![CDATA[<p>Glad it helped!  And yes on both counts &#8212; the lack of useful examples is frustrating AND it would be nice to be able to tell mysql_p?connect() to use it like that.  Actually what would be the most useful to most people would be to have ssh2_socket_create_pair() a la socket_create_pair() </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alfred Armstrong</title>
		<link>http://blog.apokalyptik.com/2010/08/27/php-ssh2-code/comment-page-1/#comment-9155</link>
		<dc:creator>Alfred Armstrong</dc:creator>
		<pubDate>Fri, 03 Sep 2010 07:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=659#comment-9155</guid>
		<description><![CDATA[Just what I&#039;ve been looking for. There&#039;s a sad lack of practical examples of usage of the ssh2_tunnel. It&#039;s a pity mysql can&#039;t be connected directly through the tunnel to save having to use a local port, isn&#039;t it? ]]></description>
		<content:encoded><![CDATA[<p>Just what I&#039;ve been looking for. There&#039;s a sad lack of practical examples of usage of the ssh2_tunnel. It&#039;s a pity mysql can&#039;t be connected directly through the tunnel to save having to use a local port, isn&#039;t it? </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thorsten Ott</title>
		<link>http://blog.apokalyptik.com/2010/08/27/php-ssh2-code/comment-page-1/#comment-9116</link>
		<dc:creator>Thorsten Ott</dc:creator>
		<pubDate>Sat, 28 Aug 2010 13:35:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=659#comment-9116</guid>
		<description><![CDATA[That&#039;s an other great finding on your blog. I&#039;m sure I&#039;ll need it at some point. ]]></description>
		<content:encoded><![CDATA[<p>That&#039;s an other great finding on your blog. I&#039;m sure I&#039;ll need it at some point. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frieder</title>
		<link>http://blog.apokalyptik.com/2010/08/27/php-ssh2-code/comment-page-1/#comment-9115</link>
		<dc:creator>Frieder</dc:creator>
		<pubDate>Sat, 28 Aug 2010 03:26:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=659#comment-9115</guid>
		<description><![CDATA[nice to know, thanks! ]]></description>
		<content:encoded><![CDATA[<p>nice to know, thanks! </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 2/20 queries in 0.006 seconds using memcached
Object Caching 561/584 objects using memcached

 Served from: blog.apokalyptik.com @ 2013-05-21 14:59:05 by W3 Total Cache -->