D
D
Dmitry Petrik2014-09-08 12:30:05
linux
Dmitry Petrik, 2014-09-08 12:30:05

PHP Telnet authorization error. What could be the problem?

Task: from the linux web server through php, telnet to the windows server, ping the site and get a response.
I am using this script. However, my whole task stops at the stage of connecting to the Telnet server. The script throws an error:

[PHP Telnet] Connect failed: Login failed

Here is the code:
<?php
require_once "PHPTelnet.php";
$telnet = new PHPTelnet();
// if the first argument to Connect is blank,
// PHPTelnet will connect to the local host via 127.0.0.1
$result = $telnet->Connect('119.59.117.4','telnet','telnet');
if ($result == 0) {
$telnet->DoCommand('ping ya.ru', $result);
// NOTE: $result may contain newlines
echo $result;
// say Disconnect(0); to break the connection without explicitly logging out
$telnet->Disconnect();
}
?>

Login and password for connection are correct. Through the console from a linux machine, I cling to a windows server with this username and password without any problems. Everything works perfectly. But this cannot be done via the web.
What could be the snag?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
throughtheether, 2014-09-08
@throughtheether

Through the console from a linux machine, I cling to a windows server with this username and password without any problems.
Are you sure the username and password are the same? Can't Latin letters be replaced by Cyrillic letters, similar in spelling (example, e and e)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question