로딩
요청 처리 중입니다...

SSH2 ssh2_exec 사용하기

 SSH2 ssh2_exec 사용하기

$pubKey = "id_rsa.pub"; $priKey = "id_rsa"; $conn = ssh2_connect('111.111.111.111', 1111); if (ssh2_auth_pubkey_file($conn, 'ID', $pubKey, $priKey)) { echo "Public Key Authentication Successful\n"; } else { die('Public Key Authentication Failed'); exit; } $stream = ssh2_exec($conn, 'ls /'); $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); // Enable blocking for both streams stream_set_blocking($errorStream, true); stream_set_blocking($stream, true); // Whichever of the two belo...