--- lbbs/src/net_server.c 2025/06/29 03:32:39 1.70 +++ lbbs/src/net_server.c 2025/09/22 05:07:22 1.71 @@ -125,6 +125,7 @@ static ssh_channel new_session_channel(s static int fork_server(void) { ssh_event event; + long int ssh_timeout = 0; int pid; int i; int ret; @@ -176,6 +177,13 @@ static int fork_server(void) ssh_callbacks_init(&cb); ssh_set_server_callbacks(SSH_session, &cb); + ssh_timeout = 60; // second + if (ssh_options_set(SSH_session, SSH_OPTIONS_TIMEOUT, &ssh_timeout) < 0) + { + log_error("Error setting SSH options: %s\n", ssh_get_error(SSH_session)); + goto cleanup; + } + if (ssh_handle_key_exchange(SSH_session)) { log_error("ssh_handle_key_exchange() error: %s\n", ssh_get_error(SSH_session)); @@ -201,6 +209,13 @@ static int fork_server(void) log_error("SSH auth error, tried %d times\n", cb_data.tries); goto cleanup; } + + ssh_timeout = 0; + if (ssh_options_set(SSH_session, SSH_OPTIONS_TIMEOUT, &ssh_timeout) < 0) + { + log_error("Error setting SSH options: %s\n", ssh_get_error(SSH_session)); + goto cleanup; + } } // Redirect Input