Subject: [libssh2] libssh2-0.15 Problems authenticating

[libssh2] libssh2-0.15 Problems authenticating

From: Paul Thomas <thomaspu_at_gmail.com>
Date: Sun, 15 Jul 2007 19:43:52 -0400

Greetings Devs,

I apologize in advance if this is not the right place to post on for help
and problems about the library. Please correct me if it is. I need help
figuring out why the library doesn't work.

I'm working on a project and am wanting to use your ssh library to make my
life a little easier. It looks to be exactly what I need: cross-platform and
built for speed. I've been working on getting my development enviornment
setup for both windows and linux and have stumbled into a few problems with
the library. I was able to resolve some items, but the 2nd one has me dead
in the water.

A word on my enviornments:
Windows XP: MS VS 2005 w/SP1, zlib 1.2.3, openssl-0.9.8.e
Gentoo Linux: KDevelop 3.4.1, zlib 1.2.3, openssl-0.9.8d

1) On windows with visual studio 2005, the project doesn't compile, but I
was able to fix it so that id did. The solution ended up being adding two
typdefs under the #else section of the _MSC_VER ifdefs in the
libssh2.hfile. In other words this:

#if defined(LIBSSH2_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1300)
typedef unsigned __int64 libssh2_uint64_t;
typedef __int64 libssh2_int64_t;
#if (_MSC_VER <= 1200)
typedef long ssize_t;
typedef unsigned int uint32_t;
#endif
#else
typedef unsigned long long libssh2_uint64_t;
typedef long long libssh2_int64_t;
#endif

Became this:

#if defined(LIBSSH2_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1300)
typedef unsigned __int64 libssh2_uint64_t;
typedef __int64 libssh2_int64_t;
#if (_MSC_VER <= 1200)
typedef long ssize_t;
typedef unsigned int uint32_t;
#endif
#else
typedef unsigned long long libssh2_uint64_t;
typedef long long libssh2_int64_t;
typedef long ssize_t;
typedef unsigned int uint32_t;
#endif

2) I was trying to use the ssh2 connect example supplied by the ssh2.c file
to make sure that the library was working ok. I am unable to successfully
authenticate. The libssh2_userauth_password() function always fails. I've
double checked my host, username and password and triple checked them. I'm
able to connect up ok with another ssh client and these credentials, but
they fail with this library. I was hard coding my username and password in
so that I could make sure that they were correct in spelling and case and
specifying the host by both IP and hostname. Is this a bug or does it work
for any of you? Both libssh2 0.15 and 0.14 on both Windows or Linux have
this issue. Help!?

3) When I was trying to run the ssh2.c example on linux, I noticed that the
libssh2_config.h file wasn't present after installing 0.15 on my Gentoo
Linux system. Now is probably a problem in the ebuild (Gentoo's install
system), because it is in the source tar.gz. But let me ask this: Is the
user (me) expected to supply this file? I noticed that it was mainly setup
for windows. Do you have a version of this that cross-platform geared? Or is
this something perhaps I could contribute to your project? The app that I'm
making is geared to run on both linux and windows and compile under quite a
few different compilers.

4) On Linux, the ssh2.c example program, I wasn't able to compile it in its
current state. I had to add an include:
#include <arpa/inet.h>

I hope some of this might be useful to you all and I hope perhaps one of you
has an idea on my authentication problem. I could really use some help
there! I would be up for contributing/testing stuff it if helps. Like making
this more cross-platform friendly ;p

PS- I added myself to the dev list, so you can email me either through there
or my personal email address.

Thanks,
Paul Thomas

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-07-16