Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user = "testauser";
- $password = "TestUser123";
- $host = "83.220.174.89";
- echo '123';
- $connection = ssh2_connect($host);
- if (false === $connection) {
- die('connection failed');
- }
- echo '321';
- $auth = @ssh2_auth_password($connection, $user, $password);
- if (false === $connection) {
- die('authentication failed');
- }
- $stream = ssh2_exec($connection, "touch testauser_launch");
- stream_set_blocking($stream, true);
- $stream_out = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO);
- echo stream_get_contents($stream_out);
- ssh2_exec($connection, "exit");
- unset($connection);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement