<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://wiki2.linuxformat.ru/skins/common/feed.css?97"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>LXF81:PHP - История изменений</title>
		<link>http://wiki2.linuxformat.ru/index.php?title=LXF81:PHP&amp;action=history</link>
		<description>История изменений этой страницы в вики</description>
		<language>ru</language>
		<generator>MediaWiki 1.11.1</generator>
		<lastBuildDate>Wed, 13 May 2026 22:25:50 GMT</lastBuildDate>
		<item>
			<title>Yaleks: шаблон</title>
			<link>http://wiki2.linuxformat.ru/index.php?title=LXF81:PHP&amp;diff=4931&amp;oldid=prev</link>
			<description>&lt;p&gt;шаблон&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Версия 09:38, 30 июня 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{Цикл/PHP}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== PHP Безопасная оболочка ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== PHP Безопасная оболочка ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'' Устали от людей, взламывающих ваш элитарный шифр rot26? '''Пол Хадсон''' научит вас защищаться. ''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'' Устали от людей, взламывающих ваш элитарный шифр rot26? '''Пол Хадсон''' научит вас защищаться. ''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Mon, 30 Jun 2008 09:38:56 GMT</pubDate>			<dc:creator>Yaleks</dc:creator>			<comments>http://wiki2.linuxformat.ru/index.php/%D0%9E%D0%B1%D1%81%D1%83%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5:LXF81:PHP</comments>		</item>
		<item>
			<title>Yaleks в 15:46, 30 марта 2008</title>
			<link>http://wiki2.linuxformat.ru/index.php?title=LXF81:PHP&amp;diff=3717&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://wiki2.linuxformat.ru/index.php?title=LXF81:PHP&amp;amp;diff=3717&amp;amp;oldid=3716&quot;&gt;(Различия между версиями)&lt;/a&gt;</description>
			<pubDate>Sun, 30 Mar 2008 15:46:48 GMT</pubDate>			<dc:creator>Yaleks</dc:creator>			<comments>http://wiki2.linuxformat.ru/index.php/%D0%9E%D0%B1%D1%81%D1%83%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5:LXF81:PHP</comments>		</item>
		<item>
			<title>Yaleks в 15:45, 30 марта 2008</title>
			<link>http://wiki2.linuxformat.ru/index.php?title=LXF81:PHP&amp;diff=3716&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Версия 15:45, 30 марта 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“192&lt;/del&gt;.168.133.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98”&lt;/del&gt;, 22);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;192&lt;/ins&gt;.168.133.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98&amp;quot;&lt;/ins&gt;, 22);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Could &lt;/del&gt;not connect!&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Could &lt;/ins&gt;not connect!&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo ssh2_fingerprint($conn);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo ssh2_fingerprint($conn);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 65:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 65:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$methods = array(&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$methods = array(&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“client_to_server” &lt;/del&gt;=&amp;gt; array(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“crypt” &lt;/del&gt;=&amp;gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“3des&lt;/del&gt;-&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;cbc”&lt;/del&gt;),&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;client_to_server&amp;quot; &lt;/ins&gt;=&amp;gt; array(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;crypt&amp;quot; &lt;/ins&gt;=&amp;gt; &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;3des&lt;/ins&gt;-&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;cbc&amp;quot;&lt;/ins&gt;),&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“server_to_client” &lt;/del&gt;=&amp;gt; array(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“crypt” &lt;/del&gt;=&amp;gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“3des&lt;/del&gt;-&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;cbc”&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;server_to_client&amp;quot; &lt;/ins&gt;=&amp;gt; array(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;crypt&amp;quot; &lt;/ins&gt;=&amp;gt; &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;3des&lt;/ins&gt;-&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;cbc&amp;quot;&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“192&lt;/del&gt;.168.133.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98”&lt;/del&gt;, 22, $methods);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;192&lt;/ins&gt;.168.133.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98&amp;quot;&lt;/ins&gt;, 22, $methods);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Could &lt;/del&gt;not connect!&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Could &lt;/ins&gt;not connect!&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$methods_neg = ssh2_methods_negotiated($conn);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$methods_neg = ssh2_methods_negotiated($conn);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Keys &lt;/del&gt;negotiated with: {$methods_neg[&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘kex’&lt;/del&gt;]}\&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n”&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Keys &lt;/ins&gt;negotiated with: {$methods_neg[&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'kex'&lt;/ins&gt;]}\&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n&amp;quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Client&lt;/del&gt;-to-server uses these methods:\&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n”&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Client&lt;/ins&gt;-to-server uses these methods:\&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n&amp;quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“ &lt;/del&gt;Encryption: {$methods_neg[&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“client_to_server”&lt;/del&gt;][&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“crypt”&lt;/del&gt;]}\&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n”&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; &lt;/ins&gt;Encryption: {$methods_neg[&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;client_to_server&amp;quot;&lt;/ins&gt;][&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;crypt&amp;quot;&lt;/ins&gt;]}\&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n&amp;quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“ &lt;/del&gt;Compression: {$methods_neg[&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“client_to_server”&lt;/del&gt;][&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“comp”&lt;/del&gt;]}\&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n”&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; &lt;/ins&gt;Compression: {$methods_neg[&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;client_to_server&amp;quot;&lt;/ins&gt;][&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;comp&amp;quot;&lt;/ins&gt;]}\&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n&amp;quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Server&lt;/del&gt;-to-client uses these methods:\&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n”&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Server&lt;/ins&gt;-to-client uses these methods:\&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n&amp;quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“ &lt;/del&gt;Encryption: {$methods_neg[&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“server_to_client”&lt;/del&gt;][&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“crypt”&lt;/del&gt;]}\&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n”&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; &lt;/ins&gt;Encryption: {$methods_neg[&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;server_to_client&amp;quot;&lt;/ins&gt;][&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;crypt&amp;quot;&lt;/ins&gt;]}\&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n&amp;quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“ &lt;/del&gt;Compression: {$methods_neg[&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“server_to_client”&lt;/del&gt;][&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“comp”&lt;/del&gt;]}\&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n”&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot; &lt;/ins&gt;Compression: {$methods_neg[&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;server_to_client&amp;quot;&lt;/ins&gt;][&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;comp&amp;quot;&lt;/ins&gt;]}\&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n&amp;quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 110:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 110:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;на удаленный сервер. Для начала давайте создадим локальный файл,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;на удаленный сервер. Для начала давайте создадим локальный файл,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;выполнив следующую команду:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;выполнив следующую команду:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;echo &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Hello&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;world” &lt;/del&gt;&amp;gt; hello.txt&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Hello&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;world&amp;quot; &lt;/ins&gt;&amp;gt; hello.txt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/source&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;А теперь передадим наше приветствие на сервер. Вам потребуется&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;А теперь передадим наше приветствие на сервер. Вам потребуется&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 118:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 120:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“192&lt;/del&gt;.168.133.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98”&lt;/del&gt;, 22);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;192&lt;/ins&gt;.168.133.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98&amp;quot;&lt;/ins&gt;, 22);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Could &lt;/del&gt;not connect!&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Could &lt;/ins&gt;not connect!&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_auth_password($conn, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“username”&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“password”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_auth_password($conn, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;username&amp;quot;&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;password&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_scp_send($conn, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“hello&lt;/del&gt;.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt”&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“&lt;/del&gt;/home/&amp;lt;имя удаленного&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_scp_send($conn, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;hello&lt;/ins&gt;.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt&amp;quot;&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/ins&gt;/home/&amp;lt;имя удаленного пользователя&amp;gt;/hello.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;пользователя&amp;gt;/hello.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 131:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 132:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;поменять местами второй и третий параметры.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;поменять местами второй и третий параметры.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_scp_recv($conn, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“&lt;/del&gt;/home/yourremoteusername/hello.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt”&lt;/del&gt;,&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;”hello&lt;/del&gt;.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt”&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_scp_recv($conn, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/ins&gt;/home/yourremoteusername/hello.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt&amp;quot;&lt;/ins&gt;,&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;hello&lt;/ins&gt;.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt&amp;quot;&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 139:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 140:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“192&lt;/del&gt;.168.133.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98”&lt;/del&gt;, 22);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;192&lt;/ins&gt;.168.133.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98&amp;quot;&lt;/ins&gt;, 22);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Could &lt;/del&gt;not connect!&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Could &lt;/ins&gt;not connect!&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_auth_password($conn, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“username”&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“password”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_auth_password($conn, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;username&amp;quot;&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;password&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$sftp = ssh2_sftp($conn);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$sftp = ssh2_sftp($conn);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$file = file_get_contents(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“ssh2&lt;/del&gt;.sftp://$sftp/home/paul/hello.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$file = file_get_contents(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;ssh2&lt;/ins&gt;.sftp://$sftp/home/paul/hello.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;txt&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo $file;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;echo $file;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 167:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 168:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“192&lt;/del&gt;.168.133.&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98”&lt;/del&gt;, 22);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$conn = ssh2_connect(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;192&lt;/ins&gt;.168.133.&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;98&amp;quot;&lt;/ins&gt;, 22);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Could &lt;/del&gt;not connect!&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if (!$conn) die(&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;Could &lt;/ins&gt;not connect!&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_auth_password($conn, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“username”&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“password”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ssh2_auth_password($conn, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;username&amp;quot;&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;password&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$stdio = ssh2_shell($conn);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;$stdio = ssh2_shell($conn);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;sleep(1);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;sleep(1);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;while($line = fgets($stdio)) echo $line;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;while($line = fgets($stdio)) echo $line;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fwrite($stdio, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“uname &lt;/del&gt;-a\&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n”&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fwrite($stdio, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;uname &lt;/ins&gt;-a\&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;n&amp;quot;&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;sleep(1);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;sleep(1);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;while($line = fgets($stdio)) echo $line;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;while($line = fgets($stdio)) echo $line;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Sun, 30 Mar 2008 15:45:53 GMT</pubDate>			<dc:creator>Yaleks</dc:creator>			<comments>http://wiki2.linuxformat.ru/index.php/%D0%9E%D0%B1%D1%81%D1%83%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5:LXF81:PHP</comments>		</item>
		<item>
			<title>Yaleks в 13:55, 10 марта 2008</title>
			<link>http://wiki2.linuxformat.ru/index.php?title=LXF81:PHP&amp;diff=688&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Версия 13:55, 10 марта 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 55:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 55:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;шифрование и устойчивый метод обмена ключами, но у вас есть возможность снизить планку, если клиент или сервер не понимают сильных алгоритмов. Чтобы изменить свойства подключения используется третий параметр функции ssh2_connect(). Он должен быть массивом, содержащим&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;шифрование и устойчивый метод обмена ключами, но у вас есть возможность снизить планку, если клиент или сервер не понимают сильных алгоритмов. Чтобы изменить свойства подключения используется третий параметр функции ssh2_connect(). Он должен быть массивом, содержащим&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ключи “kex”, “client_to_server” и “server_to_client”. Значением первого ключа, “kex”, должен выступить алгоритм обмена ключами, который вы&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;ключи “kex”, “client_to_server” и “server_to_client”. Значением первого ключа, “kex”, должен выступить алгоритм обмена ключами, который вы&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;запрашиваете. Здесь можно указать diffie-hellman-group1-sha1, diffiehellman-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;запрашиваете. Здесь можно указать diffie-hellman-group1-sha1, diffiehellman-group14-sha1 или diffie-hellman-group-exchange-sha1.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;group14-sha1 или diffie-hellman-group-exchange-sha1.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Параметры “client_to_server” и “server_to_client” сами являются массивами, определяющими объявленные алгоритм шифрования (“crypt”),&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Параметры “client_to_server” и “server_to_client” сами являются массивами, определяющими объявленные алгоритм шифрования (“crypt”),&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;метод сжатия (“comp”) и метод MAC (“mac”). Например, если вы &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;хоти-&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;метод сжатия (“comp”) и метод MAC (“mac”). Например, если вы &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;хотите &lt;/ins&gt;использовать довольно небезопасное SSH-соединение (это бывает&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;те &lt;/del&gt;использовать довольно небезопасное SSH-соединение (это бывает&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;возможно в доверенной сети, если для вас особенно важна скорость),&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;возможно в доверенной сети, если для вас особенно важна скорость),&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;то вы можете запросить шифрование по алгоритму 3DES вместо AES,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;то вы можете запросить шифрование по алгоритму 3DES вместо AES,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 89:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 87:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;что приводит к тому что блоки, содержащие один и тот же зашифрованный текст оказываются совершенно непохожи друг на друга.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;что приводит к тому что блоки, содержащие один и тот же зашифрованный текст оказываются совершенно непохожи друг на друга.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Если вы хотите попробовать настройку “comp”, укажите ее в &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;мас-&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Если вы хотите попробовать настройку “comp”, укажите ее в &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;массивах &lt;/ins&gt;“client_to_server” и “server_to_client”. В качестве значения&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;сивах &lt;/del&gt;“client_to_server” и “server_to_client”. В качестве значения&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;используйте “zlib”.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;используйте “zlib”.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 160:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 157:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;переменной $sftp нам потребовалось, чтобы указать, из какого потока&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;переменной $sftp нам потребовалось, чтобы указать, из какого потока&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;выполнять чтение. И обратите внимание на то, что нам вновь пришлось&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;выполнять чтение. И обратите внимание на то, что нам вновь пришлось&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;полностью указать полный путь, поскольку по умолчанию поиск &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;выпол-&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;полностью указать полный путь, поскольку по умолчанию поиск &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;выполняется &lt;/ins&gt;в корневом каталоге.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;няется &lt;/del&gt;в корневом каталоге.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Я заказал безопасный канал===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Я заказал безопасный канал===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Нашим последним SSH-трюком будет получение полноценной SSH-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Нашим последним SSH-трюком будет получение полноценной SSH-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;оболочки, которую мы можем читать и писать так, будто это обычный&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;оболочки, которую мы можем читать и писать так, будто это обычный&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;терминал. PHP вновь интерпретирует ее как локальный файл, так что&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;терминал. PHP вновь интерпретирует ее как локальный файл, так что&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;мы сможем использовать функции fread() and fgets() обычным &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;обра-&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;мы сможем использовать функции fread() and fgets() обычным &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;образом&lt;/ins&gt;. Требуется только придерживаться одного главного правила – нужно дать удаленному компьютеру время на то, чтобы выполнить нашу&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;зом&lt;/del&gt;. Требуется только придерживаться одного главного правила – нужно дать удаленному компьютеру время на то, чтобы выполнить нашу&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;команду, иначе мы будем искать результат до того, как он будет готов.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;команду, иначе мы будем искать результат до того, как он будет готов.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Итак, вот код:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Итак, вот код:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 191:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 186:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;писать команды и отсюда же читать результаты.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;писать команды и отсюда же читать результаты.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Для начала выполним главное правило – нам придется &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;исполь-&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Для начала выполним главное правило – нам придется &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;использовать &lt;/ins&gt;функцию sleep(), чтобы прервать выполнение на 1 секунду&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;зовать &lt;/del&gt;функцию sleep(), чтобы прервать выполнение на 1 секунду&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;и дать серверу время очистить соединение и вывести шапку (строку&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;и дать серверу время очистить соединение и вывести шапку (строку&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;приветствия удаленного пользователя). Затем мы используем цикл&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;приветствия удаленного пользователя). Затем мы используем цикл&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Mon, 10 Mar 2008 13:55:14 GMT</pubDate>			<dc:creator>Yaleks</dc:creator>			<comments>http://wiki2.linuxformat.ru/index.php/%D0%9E%D0%B1%D1%81%D1%83%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5:LXF81:PHP</comments>		</item>
		<item>
			<title>Yaleks: Новая: == PHP Безопасная оболочка == '' Устали от людей, взламывающих ваш элитарный шифр rot26? '''Пол Хадсон''' научит...</title>
			<link>http://wiki2.linuxformat.ru/index.php?title=LXF81:PHP&amp;diff=171&amp;oldid=prev</link>
			<description>&lt;p&gt;Новая: == PHP Безопасная оболочка == '' Устали от людей, взламывающих ваш элитарный шифр rot26? '''Пол Хадсон''' научит...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая статья&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== PHP Безопасная оболочка ==&lt;br /&gt;
'' Устали от людей, взламывающих ваш элитарный шифр rot26? '''Пол Хадсон''' научит вас защищаться. ''&lt;br /&gt;
&lt;br /&gt;
Геродот однажды сказал: “Ни одно расширение не зови&lt;br /&gt;
счастливым, пока не начал его использовать”. Ну хорошо, он&lt;br /&gt;
сказал не совсем так, но в любом случае это справедливо:&lt;br /&gt;
в составе PECL (PHP Extention Community Library) можно найти сотни&lt;br /&gt;
странных, удивительных и великолепных расширений, ждущих когда же&lt;br /&gt;
мы их попробуем, однако, пока вы не узнаете о существовании одного&lt;br /&gt;
из них, пока не попробуете сами им воспользоваться – оно для вас все&lt;br /&gt;
равно что не существует.&lt;br /&gt;
&lt;br /&gt;
Эта статья посвящена изучению одной из скрытых драгоценностей&lt;br /&gt;
PECL – расширению SSH2. Оно позволяет вам создавать безопасные&lt;br /&gt;
зашифрованные каналы связи через Интернет, используя PHP, а затем&lt;br /&gt;
использовать их для выполнения команд оболочки, переноса файлов и&lt;br /&gt;
всего остального, что обычно делается при помощи SSH. Да, в работе&lt;br /&gt;
через Web содержится определенный риск, но если вы а) поместили&lt;br /&gt;
поле ввода пароля на странице и б) требуете указывать его для установки SSH-соединения, то вы находитесь в относительной безопасности. С&lt;br /&gt;
другой стороны, если вы пишите скрипты, которые будете вызывать из&lt;br /&gt;
локальной консоли, это расширение оказывается мощным средством&lt;br /&gt;
для выполнения автоматических запросов к удаленным серверам вдали&lt;br /&gt;
от назойливых взглядов хакеров.&lt;br /&gt;
===Подключение===&lt;br /&gt;
Я почти уверен, что расширение PHP SSH у вас не установлено, что не&lt;br /&gt;
удивительно, поскольку оно не распространяется вместе с PHP, а библиотека от которой оно зависит (libssh2) очень редко включается в состав&lt;br /&gt;
дистрибутивов. После того, как вы пройдете все этапы установки (они&lt;br /&gt;
описаны во врезке справа), вам потребуется выполнить маленький тест,&lt;br /&gt;
просто чтобы убедиться, что все в порядке. Попробуйте что-то вроде:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$conn = ssh2_connect(“192.168.133.98”, 22);&lt;br /&gt;
if (!$conn) die(“Could not connect!”);&lt;br /&gt;
echo ssh2_fingerprint($conn);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Здесь вы видите две SSH-функции: ssh2_connect(), которая&lt;br /&gt;
выполняет подключение к серверу (первый параметр) по указанному&lt;br /&gt;
порту (второй параметр) и ssh2_fingerprint(), которая принимает&lt;br /&gt;
подключение в качестве своего единственного параметра и выводит&lt;br /&gt;
MD5-отпечаток сервера. Этот отпечаток никогда не меняется. В результате довольно легко опознать попытку атаки “man-in-the-middle” (при&lt;br /&gt;
которой хакер пререхватывает ваше соединение вместо сервера, чтобы&lt;br /&gt;
узнать пароль), поскольку полученное значение будет отличаться от&lt;br /&gt;
ожидаемого.&lt;br /&gt;
&lt;br /&gt;
Запустив этот сценарий, вы должны увидеть в качестве результата&lt;br /&gt;
отпечаток для своего сервера. Он должен полностью совпадать с тем,&lt;br /&gt;
который вы получаете, набрав ssh localhost на удаленной консоли за&lt;br /&gt;
тем исключением, что при работе в командной строке SSH разделяет&lt;br /&gt;
отпечаток на двухсимвольны блоки, отделенные двоеточиями.&lt;br /&gt;
&lt;br /&gt;
Если вы подключаетесь, указав только IP-адрес (или доменное имя&lt;br /&gt;
сервера) и порт, то библиотека SSH автоматически выберет устойчивое&lt;br /&gt;
шифрование и устойчивый метод обмена ключами, но у вас есть возможность снизить планку, если клиент или сервер не понимают сильных алгоритмов. Чтобы изменить свойства подключения используется третий параметр функции ssh2_connect(). Он должен быть массивом, содержащим&lt;br /&gt;
ключи “kex”, “client_to_server” и “server_to_client”. Значением первого ключа, “kex”, должен выступить алгоритм обмена ключами, который вы&lt;br /&gt;
запрашиваете. Здесь можно указать diffie-hellman-group1-sha1, diffiehellman-&lt;br /&gt;
group14-sha1 или diffie-hellman-group-exchange-sha1.&lt;br /&gt;
&lt;br /&gt;
Параметры “client_to_server” и “server_to_client” сами являются массивами, определяющими объявленные алгоритм шифрования (“crypt”),&lt;br /&gt;
метод сжатия (“comp”) и метод MAC (“mac”). Например, если вы хоти-&lt;br /&gt;
те использовать довольно небезопасное SSH-соединение (это бывает&lt;br /&gt;
возможно в доверенной сети, если для вас особенно важна скорость),&lt;br /&gt;
то вы можете запросить шифрование по алгоритму 3DES вместо AES,&lt;br /&gt;
используемого по умолчанию. Пример кода:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$methods = array(&lt;br /&gt;
“client_to_server” =&amp;gt; array(“crypt” =&amp;gt; “3des-cbc”),&lt;br /&gt;
“server_to_client” =&amp;gt; array(“crypt” =&amp;gt; “3des-cbc”)&lt;br /&gt;
);&lt;br /&gt;
$conn = ssh2_connect(“192.168.133.98”, 22, $methods);&lt;br /&gt;
if (!$conn) die(“Could not connect!”);&lt;br /&gt;
$methods_neg = ssh2_methods_negotiated($conn);&lt;br /&gt;
echo “Keys negotiated with: {$methods_neg[‘kex’]}\n”;&lt;br /&gt;
echo “Client-to-server uses these methods:\n”;&lt;br /&gt;
echo “ Encryption: {$methods_neg[“client_to_server”][“crypt”]}\n”;&lt;br /&gt;
echo “ Compression: {$methods_neg[“client_to_server”][“comp”]}\n”;&lt;br /&gt;
echo “Server-to-client uses these methods:\n”;&lt;br /&gt;
echo “ Encryption: {$methods_neg[“server_to_client”][“crypt”]}\n”;&lt;br /&gt;
echo “ Compression: {$methods_neg[“server_to_client”][“comp”]}\n”;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Массив $methods содержит ключи “client_to_server” и “server_to_&lt;br /&gt;
client”, которые в свою очередь содержат массивы с ключом “crypt” и значением “3des-cbc”. CBC расшифровывается как Cipher Block Chaining&lt;br /&gt;
(блочная передача зашифрованного текста), при его использовании передаваемые данные разбиваются на маленькие блоки и к каждому блоку&lt;br /&gt;
перед шифрованием применяется операция XOR с предыдущим блоком,&lt;br /&gt;
что приводит к тому что блоки, содержащие один и тот же зашифрованный текст оказываются совершенно непохожи друг на друга.&lt;br /&gt;
&lt;br /&gt;
Если вы хотите попробовать настройку “comp”, укажите ее в мас-&lt;br /&gt;
сивах “client_to_server” и “server_to_client”. В качестве значения&lt;br /&gt;
используйте “zlib”.&lt;br /&gt;
&lt;br /&gt;
В нашем коде появляется новая функция, ssh2_methods_&lt;br /&gt;
negotiated(). Она возвращает массив, содержащий описание алгоритмов обмена ключами, сжатия и MAC (Message Authentication Code, код&lt;br /&gt;
подтверждения подлинности сообщения), которые были в реальности&lt;br /&gt;
использованы при этом подключении к удаленному серверу. Затем мы&lt;br /&gt;
просто вывели на печать некоторые из полученных значений, но вы,&lt;br /&gt;
возможно, захотите выполнить какие-то свои проверки этих значений,&lt;br /&gt;
чтобы убедиться, что уровень безопасности вас устраивает.&lt;br /&gt;
===Отправьте этот файл===&lt;br /&gt;
Как любой другой пакет SSH, расширение SSH для PHP поддерживает&lt;br /&gt;
SFTP и SCP, методы безопасной передачи файлов. Оба они используют&lt;br /&gt;
одни и те же алгоритмы шифрования и поэтому одинаково безопасны,&lt;br /&gt;
вся разница в том, хотите ли вы полноценное соединение напоминающее FTP, или же вам нужно только читать и записывать файлы в стиле&lt;br /&gt;
cp.&lt;br /&gt;
&lt;br /&gt;
Давайте сначала посмотрим на реализацию SCP, который был разработан чтобы осуществлять копирование файлов по принципу команды&lt;br /&gt;
cp, но только через защищенное интернет-соединение. Рассмотрим две&lt;br /&gt;
новых функции: ssh2_auth_password() выполняет аутентификацию&lt;br /&gt;
нашего соединения, а ssh2_scp_send() копирует локальный файл&lt;br /&gt;
на удаленный сервер. Для начала давайте создадим локальный файл,&lt;br /&gt;
выполнив следующую команду:&lt;br /&gt;
 echo “Hello, world” &amp;gt; hello.txt&lt;br /&gt;
&lt;br /&gt;
А теперь передадим наше приветствие на сервер. Вам потребуется&lt;br /&gt;
указать имя пользователя и пароль для подключения к серверу, для&lt;br /&gt;
этого просто замените в следующем сценарии строки “username” и&lt;br /&gt;
“password” на правильные значения.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$conn = ssh2_connect(“192.168.133.98”, 22);&lt;br /&gt;
if (!$conn) die(“Could not connect!”);&lt;br /&gt;
ssh2_auth_password($conn, “username”, “password”);&lt;br /&gt;
ssh2_scp_send($conn, “hello.txt”, “/home/&amp;lt;имя удаленного&lt;br /&gt;
пользователя&amp;gt;/hello.txt”);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Обратите внимание, вам нужно указать будущее местоположение&lt;br /&gt;
файла на удаленном сервере, в нашем случае это /home/&amp;lt;имя удаленного пользователя&amp;gt;/hello.txt. Получение файлов происходит&lt;br /&gt;
так же просто, достаточно использовать функцию ssh2_scp_recv() и&lt;br /&gt;
поменять местами второй и третий параметры.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
ssh2_scp_recv($conn, “/home/yourremoteusername/hello.txt”,”hello.txt”)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Второй способ передачи файлов – это использование SFTP, который позволяет выполнять FTP-подобные команды (например, mkdir, stat&lt;br /&gt;
и так далее) по защищенному SSH-каналу. И, что более важно, SFTP в&lt;br /&gt;
PHP реализован как оболочка для fopen, что значит вы можете использовать любые файловые функции PHP. Например:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$conn = ssh2_connect(“192.168.133.98”, 22);&lt;br /&gt;
if (!$conn) die(“Could not connect!”);&lt;br /&gt;
ssh2_auth_password($conn, “username”, “password”);&lt;br /&gt;
$sftp = ssh2_sftp($conn);&lt;br /&gt;
$file = file_get_contents(“ssh2.sftp://$sftp/home/paul/hello.txt”);&lt;br /&gt;
echo $file;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Итак, мы подключились к удаленному серверу и авторизовались на&lt;br /&gt;
нем, указав имя пользователя и пароль. Затем мы вызвали функцию&lt;br /&gt;
ssh2_sftp() для полученного соединения, которая выполнила SFTP-&lt;br /&gt;
подключение и вернула его дескриптор. Именно этот номер потребуется&lt;br /&gt;
для использования обычных файловых функций, так что мы присвоили&lt;br /&gt;
его переменной $sftp. Теперь мы можем вызвать функцию file_get_&lt;br /&gt;
contents(), указав в ssh2.sftp:// в качестве протокола, и PHP прочитает содержимое файла через прозрачное SSH-подключение. Значение&lt;br /&gt;
переменной $sftp нам потребовалось, чтобы указать, из какого потока&lt;br /&gt;
выполнять чтение. И обратите внимание на то, что нам вновь пришлось&lt;br /&gt;
полностью указать полный путь, поскольку по умолчанию поиск выпол-&lt;br /&gt;
няется в корневом каталоге.&lt;br /&gt;
===Я заказал безопасный канал===&lt;br /&gt;
Нашим последним SSH-трюком будет получение полноценной SSH-&lt;br /&gt;
оболочки, которую мы можем читать и писать так, будто это обычный&lt;br /&gt;
терминал. PHP вновь интерпретирует ее как локальный файл, так что&lt;br /&gt;
мы сможем использовать функции fread() and fgets() обычным обра-&lt;br /&gt;
зом. Требуется только придерживаться одного главного правила – нужно дать удаленному компьютеру время на то, чтобы выполнить нашу&lt;br /&gt;
команду, иначе мы будем искать результат до того, как он будет готов.&lt;br /&gt;
Итак, вот код:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$conn = ssh2_connect(“192.168.133.98”, 22);&lt;br /&gt;
if (!$conn) die(“Could not connect!”);&lt;br /&gt;
ssh2_auth_password($conn, “username”, “password”);&lt;br /&gt;
$stdio = ssh2_shell($conn);&lt;br /&gt;
sleep(1);&lt;br /&gt;
while($line = fgets($stdio)) echo $line;&lt;br /&gt;
fwrite($stdio, “uname -a\n”);&lt;br /&gt;
sleep(1);&lt;br /&gt;
while($line = fgets($stdio)) echo $line;&lt;br /&gt;
fclose($stdio);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Все вплоть до вызова ssh2_shell() остается прежним. Новая для&lt;br /&gt;
нас функция ssh2_shell() принимает SSH-соединение в качестве параметра и возвращает дескриптор, который указывает на стандартный&lt;br /&gt;
поток ввода и стандартный поток вывода SSH-оболочки, на который&lt;br /&gt;
программы выводят результаты своей работы. Именно сюда мы должны&lt;br /&gt;
писать команды и отсюда же читать результаты.&lt;br /&gt;
&lt;br /&gt;
Для начала выполним главное правило – нам придется исполь-&lt;br /&gt;
зовать функцию sleep(), чтобы прервать выполнение на 1 секунду&lt;br /&gt;
и дать серверу время очистить соединение и вывести шапку (строку&lt;br /&gt;
приветствия удаленного пользователя). Затем мы используем цикл&lt;br /&gt;
while, состоящий из одной строчки, чтобы прочитать и показать весь&lt;br /&gt;
текст, переданный сервером (“Welcome to XYZServer!” и так далее).&lt;br /&gt;
После того, как приглашение прочитано, мы пишем нашу команду&lt;br /&gt;
“uname –a”. Она показывает системную информацию о компьютере,&lt;br /&gt;
на котором запущена, такую как версия ядра, архитектура процессора&lt;br /&gt;
и так далее.&lt;br /&gt;
&lt;br /&gt;
После второго ожидания, пока эта команда отработает, мы делаем&lt;br /&gt;
еще один однострочный цикл while и показываем полученные от сервера данные. В конце мы закрываем поток командой fclose(), чтобы&lt;br /&gt;
прибраться за собой и на этом наш сценарий заканчивается. Красиво,&lt;br /&gt;
правда?&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Инструкции по установке SSH для PHP===&lt;br /&gt;
# Установите OpenSSL и его библиотеку разработчика: libssl-dev или libssl-devel.&lt;br /&gt;
# Вытащите libssh2 из каталога Magazine/PHP вашего диска (ищите файл libssh2-0.13.tar.gz). Распакуйте его, выполните команду ./configure, а затем переключитесь на суперпользователя и запустите make all install.&lt;br /&gt;
# Возьмите расширение PHP SSH2 из каталога Magazine/PHP вашего диска (файл ssh2-0.10.tgz), распакуйте и запустите phpize, ./configure --with-ssh2, и, наконец, make. В результате вы получите файле ssh2.so в каталоге modules. Его нужно будет скопировать в ваш каталог расширений PHP.&lt;br /&gt;
# Выполните php –i | grep ini. Эта команда покажет вам местоположение файла php.ini, скорее всего, он находится в /etc/php.ini или /usr/local/lib/php.ini. Если у вас нет php.ini, то вам потребуется скопировать php.inirecommended из исходного дистрибутива PHP установленной у вас версии.&lt;br /&gt;
# Откройте файл php.ini и найдите в нем строчку ‘extension_dir’. Скорее всего, она будет показывать на примерно такой каталог: /usr/local/lib/php/extensions/.&lt;br /&gt;
# Поскольку вы все еще находитесь в php.ini, поищите в нем слово ‘dll’, и вы попадете в подраздел с описанием расширений. Вам нужно добавить туда вот такую строчку: extension=ssh2.so.&lt;br /&gt;
# Сохраните php.ini, а затем перенесите файл modules/ssh2.so, полученный на третьем шаге в каталог с расширениями PHP&lt;br /&gt;
# Запустите команду php –m. В полученном списке вы увидите ssh2.&lt;br /&gt;
Если нет, то, видимо, один из шагов вам не удался...&lt;/div&gt;</description>
			<pubDate>Sat, 08 Mar 2008 17:44:00 GMT</pubDate>			<dc:creator>Yaleks</dc:creator>			<comments>http://wiki2.linuxformat.ru/index.php/%D0%9E%D0%B1%D1%81%D1%83%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5:LXF81:PHP</comments>		</item>
	</channel>
</rss>