[Qt-interest] qt sockets vs native sockets and libssh2
Andreas Pakulat
apaku at gmx.de
Wed Jan 12 08:40:57 CET 2011
On 12.01.11 11:26:03, Pritam Ghanghas wrote:
> On Tue, 2011-01-11 at 20:13 +0530, Andreas Pakulat wrote:
> > On 11.01.11 14:05:50, Christian Gagneraud wrote:
> > > On 01/11/2011 12:51 PM, Dmitry Teslenko wrote:
> > > > Hello!
> > > > I'm trying to get ssh port forwarding with libssh2 and qt4 gui on win32
> > > > platform.
> > > > SSH library provides usable example with native sockets and I have
> > > > problem adapt that code for qt sockets.
> > > > libssh2 works fine with native sockets work and stucks on data transfer
> > > > with qt sockets. I guess there's some kind of restriction in libssh2 or
> > > > in qt that I dont' aware of and I need your help.
> > >
> > > Why don't you don't simply fork a SSH process (using QProcess) that do
> > > the port forwarding for you?
> >
> > Because then he cannot supply a password or passphrasse to ssh unless his
> > application is always run from a terminal. And even then its very strange
> > for a GUI app to ask for password/passphrase on the terminal it was started
> > from. Hence libssh2 usage which has a hook to provide a custom way to ask
> > the user for this information.
> >
> I think he can. QProcess allows reading stdout of the process and
> writing to stdin. Though not a clean thing to do, he can read stdout of
> the process and if its asking for password write to stdin.
No he cannot. ssh doesn't read the password from stdin, it requires a
real terminal emulator to do that - at least on linux. There are ways to
do this, but they require platform-dependent code similar to what a
normal terminal does.
Andreas
--
You now have Asian Flu.
More information about the Qt-interest-old
mailing list