note 116649 added to function.ssh2-connect
| From: | thessoro at gmail dot com | Date: | Wed, 04 Feb 2015 19:38:09 +0000 |
| Subject: | note 116649 added to function.ssh2-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201590@lists.php.net to get a copy of this message | ||
Be careful when providing a specific hostkey order.
<?php
ssh2_connect('IP', 'port', array('hostkey'=>'ssh-rsa,
ssh-dss'));
?>
Will only work when the public key of the server is RSA, and not DSA also as expected. This is
caused by the empty space before the "ssh-dss".
So a similar code:
<?php
ssh2_connect('IP', 'port',
array('hostkey'=>'ssh-rsa,ssh-dss'));
?>
Will work. The HOSTKEY method is overriden using exactly what you write, so no empty spaces are
allowed.
This took me some time that you could save ;)
----
Server IP: 72.52.91.14
Probable Submitter: 217.116.1.84
----
Manual Page -- http://php.net/manual/en/function.ssh2-connect.php
Edit -- https://master.php.net/note/edit/116649
Del: integrated -- https://master.php.net/note/delete/116649/integrated
Del: useless -- https://master.php.net/note/delete/116649/useless
Del: bad code -- https://master.php.net/note/delete/116649/bad+code
Del: spam -- https://master.php.net/note/delete/116649/spam
Del: non-english -- https://master.php.net/note/delete/116649/non-english
Del: in docs -- https://master.php.net/note/delete/116649/in+docs
Del: other reasons-- https://master.php.net/note/delete/116649
Reject -- https://master.php.net/note/reject/116649
Search -- https://master.php.net/manage/user-notes.php