Qt With SSH
-
I'd like to integrate ssh into a -QT- Qt program. However, I like the way that QTcpSocket works. I've seen that you can't really use libssh2 with the QTcpSocket descriptor, since the QTcpSocket reads the stream before you can read it with the libssh2 read. Is there any way of doing this with just the standard QTcpSocket or does it have to be done in a class I create myself?
Thanks
-
Why do you want a QTcpSocket? I am sure libssh2 has some way to rrequest connections to a host. Why not just use what libssh2 provides?
Maybe you can wrap it into some nice Qt-based class with an interface similar to QTcpSocket? But that is something you need to do yourself. At east I am not aware of a nice Qt-ish ssh library.
-
You may look at the great LibQxt, an extension library for Qt. Recent development version (no stable one yet though) has some QxtSsh* classes (docs) using libssh2 internally. TBH I didn't have time to test it yet, but it should be working (or almost working at least).
EDIT (2015-08-15): Fixed links.
-
Bringing this up from the dead since I was interested in getting a Qt SSH client going.
There exists a Qt SSH client here: http://qt-apps.org/content/show.php/qPutty?content=118372
-
thanks xsacha, this helps.
At the time of this post, the sources are in :
"sourceforge":http://qputty.hg.sourceforge.net/hgweb/qputty/qputty
-
Since this is brought up, I have a question about qPutty. Does it work on Windows? I studied its source a bit, and it seems to use ssh.h. The original PuTTY wraps SSH in its own ssh.c/ssh.h, but I didn't see similar things in qPutty.
I'm also interested in making Qt work with SSH. The easiest way is still LibQxt, although it contains a bit too much things other than SSH. Hopefully there can be a way to just have only SSH libs (and cross-platform).
-
[quote author="uranusjr" date="1318894141"]The original PuTTY wraps SSH in its own ssh.c/ssh.h, but I didn't see similar things in qPutty.[/quote]
You need the original putty source code.
To compile the current (2011/11/27) version of qPutty you need the putty "pre-release":http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html (v0.62),
place putty source outside of qPutty folder and do the compiling. -
I've been using libssh2 with Qt build on MSVC2010.
Building libssh2 on MSVC2010 is very easy, just follow the instructions:
http://chaosstuff.com/build-libssh2-on-visual-studio-2010/