Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ip = '123.12.123.123';
- $user = 'root';
- $pass = 'pass';
- $conn = ssh2_connect($ip);
- ssh2_auth_password($conn, $user, $pass);
- $stream = ssh2_exec($conn, 'whoami');
- stream_set_blocking($stream, true);
- echo stream_get_contents($stream); // root
- // INSTALL EXTENSION -
- // > sudo apt-get install libssh2-php
- // > sudo /etc/init.d/apache2 restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement