Qt With SSH
-
wrote on 13 Aug 2010, 12:21 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?
Thanks
-
wrote on 13 Aug 2010, 14:14 last edited by
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.
-
wrote on 27 Oct 2010, 23:08 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.
-
wrote on 2 Jul 2011, 02:32 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
-
wrote on 17 Oct 2011, 15:25 last edited by
thanks xsacha, this helps.
At the time of this post, the sources are in :
"sourceforge":http://qputty.hg.sourceforge.net/hgweb/qputty/qputty
-
wrote on 17 Oct 2011, 23:29 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).
-
wrote on 27 Nov 2011, 16:27 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. -
wrote on 3 Dec 2011, 07:20 last edited by
Wow, thanks for the explanation! I'll look into it.
-
wrote on 6 Aug 2013, 11:57 last edited by
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/