docs
[mirrors/Programs.git] / php / sshb.php
1 #!/usr/bin/php
2 <?php
3
4 $user = 'harvie';
5 $host = 'harvie.ath.cx';
6 $port = 22;
7
8 $stdin = fopen('php://stdin', 'r');
9 while(!feof($stdin)) {
10 $pass = trim(fgets($stdin));
11 $ssh = ssh2_connect($host, $port);
12 if (ssh2_auth_password($connection, $user, $pass)) {
13 echo("Authentication Successful: $pass\n");
14 } else {
15 die("Authentication Failed...\n");
16 }
17 }
This page took 0.254337 seconds and 4 git commands to generate.