Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I know there was a previous post, but the OP indicated that he intentionally had incorrect data and it was giving him an incorrect output, I am inputting a correct IP address and port and SSH2 is triggering my failed to connect line.

if (!function_exists("ssh2_connect")) die("Error: No SSH2");
if(!($con = ssh2_connect(103.114.104.241, 22))){
  echo "Error";
} else {
    if(!ssh2_auth_password($con, root, password)) {
        echo "Error: Bad credentials.";
    } else {
        if (!($stream = ssh2_exec($con, $command ))) {
            echo "Error: Execution failed";


Where the $command variable is executing whatever command I want the server to run (in the case of this, it will hopefully eventually connect to another server to compared ping speeds to an inputed ip)

I'm lost what to try next.

What I have tried:

I have tried double checking everything, I have tried connecting to the server without the module (in Putty). Also it outputs the "Error" message, not one of my other ones.
Posted
Updated 13-Feb-21 9:51am
v2

1 solution

Sorry!!! I should have checked the other servers Fail2Ban... It had banned my main server :facepalm: Sorry to waste anyone's time!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900