Hello,
I have a problem with telnet. Lolololo's bash.profile is configured for change the password. The lines in bash.profile are:
...
passwd //ask new password to lolololo
exit //exit
I would like to change the password of lolololo from php.
I think that the next code is correct but there is a problem:
the line where it read of socket don't response.
Why?
<?
$dhost="mydomain";
echo "$dhost";
$duser="lolololo";
echo "$duser";
$dpass="lalalalala";
echo "$dpass";
$dpass2='iaiaiaiaia';
$fp = fsockopen($dhost, 23, &$errno, &$errstr);
echo "$fp";
if (!$fp) {
echo "Error: $errno - $errstr<br>\n";}
else {
echo "Sin error<br>";
$result = fwrite($fp,"$duser\n"
echo "$result<br>";
$result = fwrite($fp,"$dpass\n"
echo "$result<br>";
$result = fwrite($fp,"$dpass\n"
echo "$result<br>";
$result = fwrite($fp,"$dpass2\n"
echo "$result<br>";
$result = fwrite($fp,"$dpass2\n"
echo "$result<br>";
echo fread($fp, 100);
}
fclose($fp);
?>
Thanks people!!!!
I have a problem with telnet. Lolololo's bash.profile is configured for change the password. The lines in bash.profile are:
...
passwd //ask new password to lolololo
exit //exit
I would like to change the password of lolololo from php.
I think that the next code is correct but there is a problem:
the line where it read of socket don't response.
Why?
<?
$dhost="mydomain";
echo "$dhost";
$duser="lolololo";
echo "$duser";
$dpass="lalalalala";
echo "$dpass";
$dpass2='iaiaiaiaia';
$fp = fsockopen($dhost, 23, &$errno, &$errstr);
echo "$fp";
if (!$fp) {
echo "Error: $errno - $errstr<br>\n";}
else {
echo "Sin error<br>";
$result = fwrite($fp,"$duser\n"
echo "$result<br>";
$result = fwrite($fp,"$dpass\n"
echo "$result<br>";
$result = fwrite($fp,"$dpass\n"
echo "$result<br>";
$result = fwrite($fp,"$dpass2\n"
echo "$result<br>";
$result = fwrite($fp,"$dpass2\n"
echo "$result<br>";
echo fread($fp, 100);
}
fclose($fp);
?>
Thanks people!!!!