Php/docs/function.ssh2-methods-negotiated

提供:Dev Guides
< Php
移動先:案内検索

ssh2_methods_negotiated

(PECL ssh2 >= 0.9.0)

ssh2_methods_negotiatedネゴシエートされたメソッドのリストを返す


説明

ssh2_methods_negotiated ( resource $session ) : array

ネゴシエートされたメソッドのリストを返します。


パラメータ

session
ssh2_connect() のコールによって取得した SSH 接続リンク ID。


返り値

例1 どのメソッドでネゴシエートされたかの判定

<?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";?>

参考