LibSSH-ESP32 icon indicating copy to clipboard operation
LibSSH-ESP32 copied to clipboard

connection timeout when SSH_OPTIONS_PORT set to other port than 22

Open martinpio opened this issue 4 years ago • 1 comments

Hi!

When SSHD is running on alternative port (other than 22) and SSH_OPTIONS_PORT via ssh_options_set is configured for the libssh session in exec example, connection to server is timed out and last state of the libssh is 9.

Reconfiguring the SSHD server to default port 22, leaving out the ssh_optionts_set with SSH_OPTIONS_PORT while using the same code base leads to sucessfull connect.

Regards, Martin

martinpio avatar Oct 07 '21 21:10 martinpio

Using the following lines of code in connect_ssh I set the port to 24 and connected successfully to a remote sshd on port 24.

unsigned int port = 24;
if (ssh_options_set(session, SSH_OPTIONS_PORT, &port) < 0) {
  ssh_free(session);
  return NULL;
}

Please verify your code against my working code and let me know the outcome.

ewpa avatar Nov 07 '21 11:11 ewpa