函数名:ssh2_send_eof()
适用版本:PHP 5 >= 5.3.0, PECL ssh2 >= 0.11.0
函数描述:发送EOF到远程服务器的SSH2会话
用法: bool ssh2_send_eof(resource $session)
参数:
返回值: 成功发送EOF返回true,发送失败返回false。
示例:
// 创建SSH2会话
$connection = ssh2_connect('example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
// 打开一个shell
$shell = ssh2_shell($connection, 'xterm');
// 发送EOF到远程服务器
if (ssh2_send_eof($shell)) {
echo "EOF sent successfully.";
} else {
echo "Failed to send EOF.";
}
// 关闭SSH2会话
ssh2_disconnect($connection);
注意事项: