略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: ssh2_methods_negotiated

2024-12-22

ssh2_methods_negotiated

(PECL ssh2 >= 0.9.0)

ssh2_methods_negotiatedReturn list of negotiated methods

说明

ssh2_methods_negotiated(resource $session): array

Returns list of negotiated methods.

参数

session

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

返回值

范例

示例 #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";

?>

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.ssh2-methods-negotiated.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3