[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libssh session connection timed out error


I found the problem , in host field i wrote "localhost" as the example but
it didn't work i changed to 127.0.0.1 now it works .
Also i used freesshd just to test thanks for warning .
On Aug 25, 2014 11:14 PM, "Aris Adamantiadis" <aris@xxxxxxxxxxxx> wrote:

> Hi,
>
> Are you sure that there is no firewall ?
> Are you sure libssh does not attempt to connect on IPv6 which is not
> supported by FreeSSHd ?
>
> I would also advise you not to use FreeSSHd on a production system as it
> has a known vulnerability and no public patch:
> http://www.rapid7.com/db/modules/exploit/windows/ssh/freesshd_authbypass
>
> Regards,
>
> Aris
>
> Le 22/08/14 18:54, saeed a écrit :
> >
> > I've downloaded and compiled libssh 0.6.1 from libSSH
> > <http://www.libssh.org/> .
> > I also linked the ssh.lib,ssh.dll to a visual c++ project .
> > The library with code below compiles and run fine ,
> > but when calling ssh_connect() , it return -1 : Timeout .
> > I used the option :
> >
> >     ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY,
> >     &verbosity);
> >
> > to print the logging , and it says :
> >
> >     ssh_connect : socket connecting now waiting for callbacks to work.
> >     ssh_connect : Timeout connecting to local host.
> >
> > On my laptop i installed FreeSSHd <http://www.freesshd.com/> server
> > and connecting to it using putty works .
> >
> > My code, until the error :
> >
> > |int _tmain(int argc, _TCHAR* argv[])
> > {
> >
> > ssh_session my_ssh_session;
> > int verbosity = SSH_LOG_PROTOCOL;
> > int port = 22;
> > int rc;
> > char *password;
> > // Open session and set options
> > my_ssh_session = ssh_new();
> > if (my_ssh_session == NULL)
> >     exit(-1);
> > ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, "localhost");
> > ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
> > ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT, &port);
> > // Connect to server
> > rc = ssh_connect(my_ssh_session);
> > if (rc != SSH_OK)
> > {
> >     fprintf(stderr, "Error connecting to localhost: %s\n",
> >         ssh_get_error(my_ssh_session));
> >     ssh_free(my_ssh_session);
> >     exit(-1);
> > }
> > |
> >
> > This code example is copied from the A typical SSH session Exmple
> > <http://api.libssh.org/master/libssh_tutor_guided_tour.html> site .
> >
> >
> > --
> > Good Day
> > Saeed Hardan
>
>
>

References:
libssh session connection timed out errorsaeed <ssmixpro@xxxxxxxxx>
Re: libssh session connection timed out errorAris Adamantiadis <aris@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org