QProcess && ssh && write password
-
[quote author="unclewerner" date="1297876342"]Take a look at the official "documentation":http://doc.qt.nokia.com/4.7/qprocess.html#details . Scroll down, there is an example included.
[/quote]I already tried that example but it seems to doesn't work for ssh.
[quote author="Frank" date="1297876571"]Both for improved security and improved convenience, I would use private/public key authentication.[/quote]
My application must works in a pc and in a BeagleBoard so I'd like to use a simple solution also if less secure.
-
I read in some forum that it's impossible to pass a password to ssh using QProcess because ssh require a console...
Can someone confirm me this?
-
ssh does not read from stdin. You can easily check that with
@
echo "password" | ssh somehost
@It asks for your password on the console. Stdin is just piped through to the remote shell or whatever program is run by ssh.
You might have a look at "libssh":http://www.libssh.org or "libssh2":http://www.libssh2.org
-
[quote author="Luca" date="1297878985"]
[quote author="unclewerner" date="1297876342"]Take a look at the official "documentation":http://doc.qt.nokia.com/4.7/qprocess.html#details . Scroll down, there is an example included.
[/quote]I already tried that example but it seems to doesn't work for ssh.
[quote author="Frank" date="1297876571"]Both for improved security and improved convenience, I would use private/public key authentication.[/quote]
My application must works in a pc and in a BeagleBoard so I'd like to use a simple solution also if less secure.
[/quote]Shipping a couple of public/private keys is VERY simple (it's just a matter of putting two files in the right place). You may also evaluate expect(1) or, if under unix with a X11 environment, create a simple SSH_ASKPASS program.
-
@Luca: I wonder what ssh would do, if you use forkpty(3) on your beagleboard.
-
Thanks all,
I finally installed openssh in the BeagleBoard replacing dropbear so now I can use ssh-keygen and a private/public key authentication while dropbear hasn't ssh-keygen. -
@luca can you tell me the way you solve this problem? i meet this kind of situtation,too.
I am exhausted. -
@_hunter Read Lucas last answer: he replaced dropbear with OpenSSH and used private/public keys.
-
-
@_hunter As I said I installed Openssh the used a public key authentication. This way it doesn't ask you for a password (if configured correctly).
Once you configure Openssh server in your remote device for a public key authentication (google is your friend for it) you can simply "ssh" from your client without password.
Hope it helps.