SSH on Ubuntu
Posted: Tue Feb 12, 2008 3:28 pm
I ran the following code on a Ubuntu box running Apache/PHP and was told the SSH keys have been corrupted (and my code was the culprit.) Can anyone please tell me if there's something I should include/declude in this to prevent another issue...or this SSH issue even related to my attempts at a PHP interface for CL applications?
Code: Select all
$mtr_host = $_GET['Host'];
$mtr_packets = $_GET['Packets'];
$fp = popen("mtr -c $mtr_packets --report $mtr_host 2>&1","r");
// ping 20 times, interval 1 second
while (!feof($fp)) {
set_time_limit (120);
$results = fgets($fp, 256);
if (strlen($results) == 0) {
// stop the browser timing out
echo " ";
flush();
} else {
$tok = strtok($results, "\n");
while ($tok !== false) {
echo htmlentities(sprintf("%s\n",$tok))."<br/>"; flush();
$tok = strtok("\n");
}
}
// avoid a busy wait
sleep(1);
}