Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt With SSH
tecknophreak last edited by
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?
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.
przemoc last edited by przemoc
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.
xsacha last edited by
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
doubitchou last edited by
thanks xsacha, this helps.
At the time of this post, the sources are in :
uranusjr last edited by
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).
zetaron last edited by
[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.
uranusjr last edited by
Wow, thanks for the explanation! I'll look into it.
nchokoev last edited by
I've been using libssh2 with Qt build on MSVC2010.
Building libssh2 on MSVC2010 is very easy, just follow the instructions: