note 68046 deleted from function.ssh2-publickey-add by dave
| From: | dave@php.net | Date: | Tue, 24 Mar 2009 11:04:13 +0000 |
| Subject: | note 68046 deleted from function.ssh2-publickey-add by dave | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152373@lists.php.net to get a copy of this message | ||
Note Submitter: jmason
----
The above example should be:
...
$ssh2 = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($ssh2, 'jdoe', 'password');
$pkey = ssh2_publickey_init($ssh2);
$keyblob = base64_decode('
AAAAB3NzaC1yc2EAAAABIwAAAIEA5HVt6VqSGd5PTrLRdjNONxXH1tVFGn0
Bd26BF0aCP9qyJRlvdJ3j4WBeX4ZmrveGrjMgkseSYc4xZ26sDHwfL351xj
zaLpipu\BGRrw17mWVBhuCExo476ri5tQFzbTc54VEHYckxQ16CjSTibI5X
69GmnYC9PNqEYq/1TP+HF10=');
ssh2_publickey_add($pkey, 'ssh-rsa', $keyblob, false,
array('comment'=>"John's Key"));
...
As the ssh2_publickey_init function returns the resource that is used by the ssh2_publickey_add
function.