...
Code Block | ||||
---|---|---|---|---|
| ||||
<?php // programmed by Chun Kang
$s = ssh2_connection( '192.168.10.8', 22);
if (ssh2_auth_password( $s, 'your_id', 'your_password')) {
echo "Authentication successful!\n";
} else {
die( "Authentication failed...\n");
}
// reboot remote machine
ssh2_exec( $s, "shutdown -r -f -t 0");
?> |
...