Commit | Line | Data |
---|---|---|
8de51304 H |
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 | } |