array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.ssh2-methods-negotiated.php', 1 => 'ssh2_methods_negotiated', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'Funciones de SSH2', ), 'prev' => array ( 0 => 'function.ssh2-forward-listen.php', 1 => 'ssh2_forward_listen', ), 'next' => array ( 0 => 'function.ssh2-poll.php', 1 => 'ssh2_poll', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ssh2/functions/ssh2-methods-negotiated.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ssh2 >= 0.9.0)
ssh2_methods_negotiated — Return list of negotiated methods
Ejemplo #1 Determining what methods were negotiated
<?php
$connection = ssh2_connect('shell.example.com', 22);
$methods = ssh2_methods_negotiated($connection);
echo "Encryption keys were negotiated using: {$methods['kex']}\n";
echo "Server identified using an {$methods['hostkey']} with ";
echo "fingerprint: " . ssh2_fingerprint($connection) . "\n";
echo "Client to Server packets will use methods:\n";
echo "\tCrypt: {$methods['client_to_server']['crypt']}\n";
echo "\tComp: {$methods['client_to_server']['comp']}\n";
echo "\tMAC: {$methods['client_to_server']['mac']}\n";
echo "Server to Client packets will use methods:\n";
echo "\tCrypt: {$methods['server_to_client']['crypt']}\n";
echo "\tComp: {$methods['server_to_client']['comp']}\n";
echo "\tMAC: {$methods['server_to_client']['mac']}\n";
?>