The SSH library

libssh website has moved. It is now http://www.libssh.org.

Bugs and patches

Users of THC-HYDRA : I've made a patch for hydra-5.4 so it works with libssh 0.2 and 0.3.

Previous release

Where is libssh 0.2 page ? it's here Where is libssh 0.11 page ? it's here

Discussion

najamnajam, 2008/12/02 00:26

hi,

I am using sshlib. I am suffering a problem with it. First I configure and then install the library. Then I make an executable of sample.c using command gcc -o sample sample.o -lssh -Llibssh then I try to run it ./sample but it doesn't run and give an error that is below

/home/nmalik/ssh/libssh-0.11/sample: error while loading shared libraries: libssh.so: cannot open shared object file: No such file or directory

help me out najam

Najmus SaqibNajmus Saqib, 2008/12/09 19:48

I solve the previous problem. Now the sample.c is a client program. Since I want to integrate it in my Project so I am also looking for a server program. can some tell me the server program from examples. Actually when I have server and client programs then it will be integrated into my project. also Is some body working on the project? as I write same email to Aris Adamantiadis, but didn't get any response.

najam

Ludovic GeleLudovic Gele, 2008/12/12 15:41

Hi,

I'm trying to compile the svn version of libssh under mingw on a winXP SP3 Box.

compilation fails with this kind of error:

connect.c:43:2: #error “Your system must have select()” connect.c:47:2: #error “Your system must have getaddrinfo()” connect.c:67: error: conflicting types for 'gai_strerrorA' c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ws2tcpip.h:309: error: previous definition of 'gai_strerrorA' was here

Does someone knows what I've missed? It seems that the svn version compile on win32

Thanks in advance for all help

Benjamin WagnerBenjamin Wagner, 2008/12/14 05:37

I'm trying to use THC-Hydra with libssh, how exactly do you install that patch?

Aris AdamantiadisAris Adamantiadis, 2008/12/16 15:16

Najmus: sorry, I probably forgot to answer your mail. I'll do this asap Ludovic: Which version of mingw are you using ? I made it work with the mingw bundled with dev-cpp but I think it's quite old. I'll try to grab some time to take a look Benjamin: cd path/to/hydra ; patch -p0 < /path/to/patch if it doesn't work, try with -p1 instead.

Aris

Vassilios RaphaelVassilios Raphael, 2009/04/15 06:28

Brilliant Patch!!!!! It was -p1 not -p0. Thanks

Ludovic GeleLudovic Gele, 2008/12/17 09:44

Hi Aris,

I use the latest mingw, freshly downloaded and installed. I'll try dev-cpp, if ever it could work…

Benjamin WagnerBenjamin Wagner, 2008/12/19 03:00

I havent installed hydra yet, I cannot install it because of the dependencies problem with libssh.

Benjamin WagnerBenjamin Wagner, 2008/12/27 07:43

Any work on how to implement the patch if hydra has not been installed? i cant seem to get it working still

IsilionIsilion, 2008/12/29 03:46

hi. i canno install libssh 0.11. when i type make i get these errors:

# sudo make all make[1]: se ingresa al directorio `/libssh-0.11/libssh' make[1]: No se hace nada para `all'. make[1]: se sale del directorio `/libssh-0.11/libssh' gcc -o samplessh sample.o -lssh -Llibssh/ ln -s -sf samplessh samplesftp gcc -o samplesshd samplesshd.o -lssh -Llibssh/ samplesshd.o: file not recognized: File format not recognized collect2: ld devolvió el estado de salida 1 make: *** [all] Error 1

mikemike, 2009/02/18 02:54

hi,

I found libssh (both 0.11 or 0.2 version) can not work with libcrypto.so.0.9.8 (work well with libcrypto.so.0.9.7).

Error message when using libcrypto.so.0.9.8: * glibc detected * malloc(): memory corruption: 0x08dfcb18 * Here is backtrace: 62 if(!session→current_crypto) (gdb) 64 crypto= session→current_crypto→out_cipher; (gdb) 65 ssh_say(3,”seq num = %d, len = %d\n”,session→send_seq,len); (gdb) 66 crypto→set_encrypt_key(crypto,session→current_crypto→encryptkey); (gdb) 67 out=malloc(len); (gdb) 68 ctx=hmac_init(session→current_crypto→encryptMAC,20,HMAC_SHA1); (gdb) Breakpoint 1, hmac_init (key=0x933b8f4, len=20, type=1) at libssh/wrapper.c:81 81 ctx=malloc(sizeof(HMAC_CTX)); (gdb) 85 switch(type){ (gdb) 87 HMAC_Init(ctx,key,len,EVP_sha1()); (gdb) * glibc detected * malloc(): memory corruption: 0x0933c4e0 *

Program received signal SIGABRT, Aborted. 0x004e07a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 (gdb) backtrace #0 0x004e07a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 0x0134a7a5 in raise () from /lib/tls/libc.so.6 #2 0x0134c209 in abort () from /lib/tls/libc.so.6 #3 0x0137e71a in __libc_message () from /lib/tls/libc.so.6 #4 0x0138599c in _int_malloc () from /lib/tls/libc.so.6 #5 0×01387401 in malloc () from /lib/tls/libc.so.6 #6 0x0014698c in OPENSSL_stderr ()

 from libcrypto.so.0.9.8

#7 0×00000064 in ?? () #8 0x000008bd in ?? () #9 0x0023c380 in ?? ()

 from libcrypto.so.0.9.8

#10 0x001470f3 in CRYPTO_malloc ()

 from libcrypto.so.0.9.8

#11 0×00000064 in ?? () #12 0x0022ea67 in CAST_S_table0 ()

 from libcrypto.so.0.9.8

#13 0x000000ca in ?? () #14 0x0023c380 in ?? ()

 from libcrypto.so.0.9.8

#15 0x00239f20 in STORE_object_type_string ()

 from libcrypto.so.0.9.8

#16 0×00000000 in ?? () (gdb)

AndreyAndrey, 2009/03/03 17:16

Hi, I wonder if libssh supports IP v6 addresses?

EricEric, 2009/03/09 16:51

Hi,

libssh-0.2/libssh/server.c failed to compile under Cygwin. The following added to make it work:

#include <netinet/in.h>

PierrePierre, 2009/03/20 18:14

Finaly got this thing working, (not complaining it is due to my lack of programming knowledge). Compiled it with Dev-cpp. Got libssh.a and the include files in the right place, able to compile a little client, but it is asking for libssh.dll.

Even if I link libssh.a???

Any idea on how I can make a standalone app that will not need the dll?

Thanks

Andreas SchneiderAndreas Schneider, 2009/03/21 11:06

I've created a NSIS installer of the current 0.3 branch. If someone wants to test it. Feedback is welcome!

http://www.cynapses.org/tmp/libssh-0.2.90.exe

Mark MartinMark Martin, 2009/04/25 15:56

I have used your library to create some c++ wrappers, and mostly works, I understand it is 'thread safe' (I need to do multiply threaded sessions). However, it does not appear to be threadsafe at this point, but it is probably in my implementation. I have subclassed SshOptions with SshSession, and then subclassed that to SftpSession, however my immediate perception (without digging into library code) is that SshSession needs to be global, currently all instances create their own SshSession. So my question is, in order to be thread safe, does an SshSession need to global and static and just pass one single SshSession different SshOptions. (Note: the naming conventions used here reflect a wrapped pointer to the appropriate 'C' structures).

Thanks for your help.

Andreas SchneiderAndreas Schneider, 2009/04/30 20:12

Each connection should have it's own session. You should show some source code to get help and I suggest to use the mailing list.

http://www.libssh.org/ for more information.

Vasuki GubbiVasuki Gubbi, 2009/05/23 00:26

I get a coredump when I use your ssh library some time. I have attached the debug stack. It looks like some problem during key exchange in openssl library. Can you please provide any help on why it might be happening?

[1] _lwp_kill(0×0, 0×6, 0×0, 0×6, 0xfc00, 0×0), at 0xff2c69ec

[2] raise(0x6, 0x0, 0xff2f2d38, 0xff2a98e4, 0xffffffff, 0x6), at 0xff264a04
[3] abort(0x2d2e8, 0x1, 0xfee7b230, 0xad318, 0xff2f1318, 0x0), at 0xff241118
[4] os::abort(0x1, 0xff115574, 0x1, 0xff0fe000, 0x17574, 0x17400), at 0xfee7165c
[5] VMError::report_and_die(0xff1369c0, 0x0, 0x1, 0xff0c8247, 0xfef86150, 0x17400), at 0xfef7a5c4
[6] JVM_handle_solaris_signal(0xb, 0xdd27d908, 0xdd27d650, 0x92400, 0x0, 0xe0aaaebc), at 0xfe9a5404
[7] __sighndlr(0xb, 0xdd27d908, 0xdd27d650, 0xfe9a4968, 0x0, 0x1), at 0xff2c5924

⇒[8] call_user_handler(0xb, 0xffbffeff, 0xc, 0×0, 0xe6c71c00, 0xdd27d650), at 0xff2ba868

[9] BN_set_word(0xdd27daac, 0xccea0929, 0x11e5898, 0xdd27daac, 0xffffffe0, 0xdd27dadd), at 0xe0aaafd8
[10] BN_RECP_CTX_set(0xdd27daac, 0x11e5898, 0xdd27daac, 0x11e5898, 0x14, 0x0), at 0xe0ab1c5c
[11] BN_mod_exp_recp(0xdd27daac, 0x11e5898, 0x80, 0x0, 0x11f9050, 0xda89d8), at 0xe0aa8bf0
[12] dh_build_k(session = 0x170b830), line 282 in "dh.c"
[13] dh_handshake(session = 0x170b830), line 171 in "client.c"
[14] ssh_connect(session = 0x170b830), line 334 in "client.c"
[15] gne_ssh_connect(0x1a56138, 0x14b6668, 0x16, 0x32, 0xe0d82010, 0xe0d82000), at 0xe0cae9d4
[16] gne_connect(0x398598, 0xe0d82400, 0xa87fc2dc, 0x1a56138, 0x398640, 0x16), at 0xe0caf12c
[17] ni_connect_unlocked(0x398598, 0x1000000, 0x6231f8, 0xe0cbd8a0, 0x0, 0x0), at 0xe0cbd4f0
[18] ni_connect(0x398598, 0x1, 0xe0d65f70, 0x7de7d8, 0x398598, 0x1), at 0xe0cbd480
[19] gateway_thread(0x398670, 0xdd280000, 0x0, 0x0, 0xe0cb4680, 0x1), at 0xe0cb4774
David HeDavid He, 2009/06/06 03:05

well, I try to compile the libssh 0.3.0 under gcc 3.2.3 (RedHat AS3u9), but it failed because gcc3.2 doesn't support the -Wextra option, as I delete this option, it works. Maybe we can add a comment in INSTALL doc. the samplessh works with openssl-0.9.7a but i don't know whether it's stable :)

there is a small mistake in sample.c, when you connect to a unkown host , you permit the pub-key but you do want to save it ,the program may coredump due to a double free fault; hereis the diff output:) [root@localhost source]# diff old/libssh-0.3.0/sample.c libssh-0.3.0/sample.c 474d473 < free(hash); 480a480

free(hash);
Enter your comment (wiki syntax is allowed):
CEKUL
 
libssh/libssh.txt · Last modified: 2009/08/25 14:59 by aris
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki