SSH2 ssh2_methods_negotiated
(PECL ssh2 >= 0.9.0)
ssh2_methods_negotiated — 협상된 메서드 목록 반환
설명
ssh2_methods_negotiated(resource $session
): array
협상된 메서드 목록을 반환합니다.
매개변수
session
- ssh2_connect() 호출에서 얻은 SSH 연결 링크 식별자입니다.
반환 값
Examples
예제 #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";
?>
기타
- ssh2_connect() - SSH 서버에 연결