Jonatan Fraile | 2 May 2013 19:02
Picon

LIBSSH AND .NET

Hello,

 

Can anyone help me to how I can use this libssh with vb.net to open ssh tunnel and do a local port forwading?

 

Any sample or code would be great!

 

 

Thanks!

DrYak | 10 Apr 2013 04:52
Picon

Problems with ProxyCommand

see https://bugs.kde.org/show_bug.cgi?id=273397

------

When using a "ProxyCommand" option, libssh requires the command to be
quoted (i.e: ' ProxyCommand "ssh -q -A -X -W %h:%p JUMPHOST" ') for the
whole line to be used (otherwise only "ssh" is called).

i.e.: on the quoted string is loaded, everything else following the
blank is discarded. Parameters are split between blanks inside the
quoted string.

Result:
- kio_sftp (which is libssh-based) works
- ssh complains it can't find an executable named "ssh -q -A -X -W %h:%p
JUMPHOST" and fails.

------

This differs from ssh's own behaviour, where command should NOT be
quoted (i.e: ' ProxyCommand ssh -q -A -X -W %h:%p JUMPHOST '), otherwise
the whole quoted string is interpreted as the executable name.

i.e: the whole line is loaded and parameters are split between blanks
outside the string.

Resuot:
- ssh works as it should
- kio_sftp only runs "ssh" without any option and gets the "ssh usage"
as an error and fails.

Wang XiaoYuan | 9 Apr 2013 08:30
Picon

Invitation to connect on LinkedIn

 
 
 
 
 
From Wang XiaoYuan
 
Software Engineer at KanBa
China
 
 
 
 
 
 
 

I'd like to add you to my professional network on LinkedIn.

- Wang

 
 
 
 
 
 
 
You are receiving Invitation to Connect emails. Unsubscribe
© 2012, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA
 
Spark War | 31 Mar 2013 03:30
Picon

Re Negotiation

I have been working on a sftp server and libssh has been great but I am now having an issue the channel im using crashes after about a gig now through some searching I found ssh does a renegotiation every gig of data so that has to be whats causing it.

I have dug around and found this thread about a year ago http://www.libssh.org/archive/libssh/2012-05/0000008.html saying that libssh does not support key re-exchange right now :(

Is there any updates to this or workarounds I could do maybe specify something to tell it not to need a re key exchange or something?

Thanks for the great library.
Siim Raud | 30 Mar 2013 13:18
Picon

Compile in windows: no strtoull function found

Hi!

I'm trying to compile libssh on Windows 7 but it fails.
I've pulled libssh from the Git repo.
Installed openSSL.
Installed Visual Studio 11

Ran "cmake ../libssh -DWITH_ZLIB=No -G"NMake Makefiles""
Running nmake:

Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Scanning dependencies of target ssh_shared
[  1%] Building C object src/CMakeFiles/ssh_shared.dir/agent.c.obj
agent.c
[  2%] Building C object src/CMakeFiles/ssh_shared.dir/auth.c.obj
auth.c
C:\Users\Siim\Documents\libssh\include\libssh/priv.h(55) : fatal error C1189:
#error :  "no strtoull function found"
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe' : return code
'0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

Could you help me and tell me what am I doing wrong?
Thank you in advance!

Siim

khalifa khalifa | 27 Mar 2013 11:47
Picon
Favicon

Running error (simple ssh client)‏

Hi everybody,

I am new with this fantastic library.
I find a tutorial in this link http://api.libssh.org/master/libssh_tutorial.html that can help me to develop a simple client and server ssh to exchange file.
I am working in windows with C in netbeans. However I could not run any example since i had this error message:
---------------------------------------------------------------------------------------------------------
The application failed with exit code -1073741515 (0xc0000135).                          |
This could indicate that no required .dll was found in the PATH.                             |
Please try to start the following command from the command shell (cmd.exe).     |
This may give some additional information.                                                             |
                                                                                                                                   |
RUN FAILED (exit value -1 073 741 515, total time: 45ms)                                       |
---------------------------------------------------------------------------------------------------------

I added the ssh.lib to the path and also to the executable directory. However, I could not correct this mistakes.

could you help me please.

Thank you in advance.

Best Regards,
Favicon

Patch Submission

This is a small patch to fix memory leaks that I found during my tests.

 

***********************************************************************************************
Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive
de son ou ses destinataires. Si vous avez reçu ce message par erreur, merci d'en avertir
immédiatement l'émetteur et de détruire le message. Toute modification, édition, utilisation ou
diffusion non autorisée est interdite. L'émetteur décline toute responsabilité au titre de ce
message s'il a été modifié, déformé, falsifié, infecté par un virus ou encore édité ou diffusé
sans autorisation.


***********************************************************************************************
This message and any attachments are confidential and intended for the named addressee(s) only.
If you have received this message in error, please notify immediately the sender, then delete
the message. Any unauthorized modification, edition, use or dissemination is prohibited.
The sender shall not be liable for this message if it has been modified, altered, falsified, infected
by a virus or even edited or disseminated without authorization.
***********************************************************************************************

Attachment (0001-Memory-leak-correction.patch): application/octet-stream, 1193 bytes
Ing. Tomáš Havránek | 5 Mar 2013 21:53
Picon
Favicon

Two direct port forward channels within one session - can't read the data

Hello,
I am new with libssh and trying to use it in my project. I want to use libssh to direct port forwarding for tunneling connection from my app to Firebird DB on remote server. Because project is programmed in C# I wrote little wrapper for libssh library but there's no problem I think.

I'm able to connect to the remote server, authorize user and create forwarding channel when I need connection to the Firebird server. While I using only one channel there is no problem and I can read and write data trough open channel with ssh_channel_read and ssh_channel_write functions. The problem occures when I want to serve second connection to Firebird server and create second forward channel (so there are two living fwd channels in one session). Then I can't read data from channel after few readings and writings happens on the second channel (not same count of r/w every time - it varies from connection to connection). I tried to use callback function (ssh_channel_data_callback) on channel and it seems that the data is present because callback function is fired up. But then data is not "transfered" to ssh_channel_read function.

So there are my questions:
    Can be used two fwd channels in one session to transfer data at the same time?
    Can be used two fwd channels in one session to transfer data with use of ssh_channel_read and ssh_channel_write functions at the same time? Or should I use ssh_channel_select function?
    Is there any trick to make it work?

Thank you very much for your help. Sorry for my English.

Regards,
Tomas Havranek

Vasuki Gubbi | 7 Feb 2013 19:22
Picon

libssh crash

Hello,

I am using libssh 0.5.2. Sometimes I am seing a crash in my program. Coredump shows following stack:

#0  0x0000003ab2e32a45 in raise () from /lib64/libc.so.6
#1  0x0000003ab2e34225 in abort () from /lib64/libc.so.6
#2  0x0000003ab2e6fdfb in __libc_message () from /lib64/libc.so.6
#3  0x0000003ab2e75716 in malloc_printerr () from /lib64/libc.so.6
#4  0x0000003ab2e7abf7 in _int_realloc () from /lib64/libc.so.6
#5  0x0000003ab2e7ad55 in realloc () from /lib64/libc.so.6
#6  0x00007f050ad6026a in realloc_buffer () from /netsmart/netsmart8.0/lib/libssh.so.4
#7  0x00007f050ad603d7 in buffer_add_data () from /netsmart/netsmart8.0/lib/libssh.so.4
#8  0x00007f050ad81e3c in ssh_socket_pollcallback () from /netsmart/netsmart8.0/lib/libssh.so.4
#9  0x00007f050ad7e826 in ssh_poll_ctx_dopoll () from /netsmart/netsmart8.0/lib/libssh.so.4
#10 0x00007f050ad7f6a0 in ssh_handle_packets () from /netsmart/netsmart8.0/lib/libssh.so.4
#11 0x00007f050ad66941 in ssh_channel_poll () from /netsmart/netsmart8.0/lib/libssh.so.4

Is there any known bug in libssh related to ssh_channel_poll?

Regards,
Vasuki
Johannes Krude | 21 Jan 2013 15:11
Picon

libssh and python twisted conch ssh

hi,

I am trying to interface a libssh client with a python twisted conch
server. Unfortunately the key exchange does no succeed. It seems libssh
rejects the key exchange initiation. Below are detailed logs and dumps.
Does twisted send malformed data, does libssh not recognize compliant
data, or is this some other kind of problem?

Greetings, johannes

./samplessh from both 0.5.2 and rev de096910b37ca3474fc37d421fb051a234f5cce0
shows:
Connection failed : Timeout connecting to xx.xx.xx.xx

An anonymized pcap from rev de09...
(use with `cat | base64 -d | gzip -d > file.pcap`):
H4sIAFVL/VAAA82UXUhTYRjHn7NNPdsqdNkmEWEpYbCztvlBC1vLCsoLCRS8KtjHWZturjzG+rhZ
QVIXkVJXFjipqItRYWkXGQUiJBHsohsxdlXGRkJBF0Hoep53nTM9rl134OU853nH7/m///M/+zg7
OaEBHchXPg/A4f3CkZWTo4d56MSaFpjdS3fffM/86L4+xsMxgPZsjQc8lVdSBo4zPH5rseSmwDz7
69s7+nFS4+LTVgCNruKFTsMb4FnFAvU5rbaKyHdGiuQCs8BHshbaATzQXBl/RVSigzk3tbRwUIP0
+aTJnFx5xMgpIm+6P7qT6EjWETmH5A6kdpTS3JI1Mc3PVZrnka5NVIOUbkSNHNO7TGQiVizy8Bst
oaXWyi2n6knrfFalVUvURB3Xt+dUgYi0BqJ2dx8XnDa70BMPS0NiYLMBtx/oaof1B/be6ppoOndz
rrPrdj6K4rcHwsFgWBRCYiQS9Q4IZwZj5886BCnkdeBulSSFhEHJi+U1ryg5W9sE/9CgVS59fiod
LqfcZeXfrnO/0qUSu36vNCS3lRr7vkgsHgzjJNooPuBOc0CUWLdQ+Pz/kxBTKOr1M6esrIoGWv/Z
1Q/EBkTrpUjYp34oXobcsJuicHqxbLi2snBNbgyXewbDdbkYrkqgOBCx6hMPvQjrLUU8ka1lxHsl
iXVIdClEjohyuFA/xcNua7PZDTTmRqNeEb7he2tJ7aIMv59Yn2H3DI7KJKq5vkPjSoabaNRVJL7s
54FM8pUS3pPdxoSPqIRnFOFHZeHWn4wKsMNIfztGinbHRbEe15oXQBO/9pc138wmPlVNXGUTa9aa
X5hIxH3TfDlXdjNXkiVcWSVXtqRlV8Y+E5WI4lxZYgMjjpcg5hM1SPygEL/IxIdzZU9tYad+ojp1
Hqmv10dOMBL1D+KMhEfuBQAA

My own libssh client using 0.5.2 with high LOG_VERBOSITY says:
[1] libssh 0.5.2 (c) 2003-2010 Aris Adamantiadis (aris@...)
Distributed under the LGPL, please refer to COPYING file for information
about your rights, using threading threads_noop
[3] host xx.xx.xx.xx matches an IP address
[2] Nonblocking connection socket: 3
[2] Socket connecting, now waiting for the callbacks to work
[3] ssh_connect: Actual timeout : 30000
[3] Received POLLOUT in connecting state
[1] Socket connection callback: 1 (0)
[3] Received banner: SSH-2.0-Twisted
[1] SSH server banner: SSH-2.0-Twisted
[1] Analyzing banner: SSH-2.0-Twisted
[3] Enabling POLLOUT for socket
[1] Error : Timeout connecting to xx.xx.xx.xx
[3] ssh_connect: Actual state : 9
ssh_connect: Timeout connecting to xx.xx.xx.xx
[3] Writing on the wire a packet having 16 bytes before
[3] 16 bytes after comp + 11 padding bytes = 28 bytes packet
[3] Enabling POLLOUT for socket

赵长松 | 8 Jan 2013 15:03
Favicon

Re:Re: How to achieve a connection to server with OS suse10







-------- Forwarding messages --------
From: "赵长松" <zhaochangsong_2010 <at> 163.com>
Date: 2012-12-29 12:48:30
To: "Aris Adamantiadis" <aris <at> 0xbadc0de.be>
Subject: Re:Re: How to achieve a connection to server with OS suse10


HI,
I use libssh v0.5.2 on OS Centos 5.8. The target server is suse10 sp1 with openssh 6.0. The default authentication is keyboard-interactive authentication. I have debuged my program.
the call stack is:
ssh_userauth_password-->wait_auth_status-->ssh_handle_packets_termination-->ssh_handle_packets-->ssh_poll_ctx_dopoll
After the last function, the auth_state in session turns to SSH_AUTH_SATE_FAILED



在 2012-12-28 21:18:04,"Aris Adamantiadis" <aris <at> 0xbadc0de.be> 写道: >Hi, > >I'm trying to reproduce the problem, but couldn't have the same error as >you do. >Could you please provide more details, like the code you use (can you >reproduce it with samplessh ?) and a verbose dump (-vvv). >Please tell which libssh version you're using and on which OS. > >Thanks, > >Aris > >Le 24/12/12 14:15, 赵长松 a écrit : >>  HI,I write a ssh client with libssh,but I can't establish the >> connection to server with OS suse10.The value of session->auth_state is >> SSH_AUTH_STATE_FAILED >





Gmane