
Możliwe jest napisanie takiego jakby putty w php??
<?php $connection = ssh2_connect('127.0.0.1', 22); if(ssh2_auth_password($connection, 'login', 'haslo')){ $a=ssh2_exec($connection,"ps -A"); } } ?>
<?php $connection = ssh2_connect('127.0.0.1', 22); if(ssh2_auth_password($connection, 'login', 'haslo')){ $a=ssh2_exec($connection,"ps -A"); } } ?>
<?php $stream = ssh2_exec($connection, 'ps ax'); // The command may not finish properly if the stream is not read to end $output = stream_get_contents($stream); ?>
<?php $lala = ssh2_connect('127.0.0.1', 22); if(ssh2_auth_password($lala, 'bagsiur', 'polaris')){ $a=ssh2_exec($lala,'ekg'); if($q = ssh2_fetch_stream($a, SSH2_STREAM_STDERR)){ $result_err = stream_get_contents($q); } } ?>
<?php $lala = ssh2_connect('127.0.0.1', 22); if(ssh2_auth_password($lala, 'login', 'haslo')){ $stdio = ssh2_shell($lala,"xterm"); } } ?>
<?php $stdio = ssh2_shell($lala, 'vanilla', null, 80, 24, SSH2_TERM_UNIT_CHARS); ?>
<?php $_SESSION['polaczenie']=ssh2_connect('127.0.0.1', 22); ?>