首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ssh2_methods_negotiated

(PECL ssh2 >= 0.9.0)

ssh2_methods_negotiated — Return list of negotiated methods

Description

代码语言:javascript
复制
array ssh2_methods_negotiated ( resource $session )

Returns list of negotiated methods.

Parameters

session

An SSH connection link identifier, obtained from a call to ssh2_connect().

Return Values

Examples

Example #1 Determining what methods were negotiated

代码语言:javascript
复制
<?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";

?>

See Also

  • ssh2_connect() - Connect to an SSH server

← ssh2_fingerprint

ssh2_publickey_add →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com