ssh to mobile or embedded device using qt program
-
Hi,
I want to establish a connection with my android phone using Qprocess through ssh connection. I run sshDroid on my phone and I wrote the following code in qt to establish the ssh connection:
QString commands = "ssh root@192.168.1.102:22" ;
QProcess *process = new QProcess();
process->start(commands);if(!process->waitForStarted()){ qDebug() << "Could not wait to start..."; } if(!process->waitForFinished()) { qDebug() << "Could not wait to finish..."; } process->closeWriteChannel(); qDebug() << process->readAll();
I always get this response in my output window:
Could not wait to start...
Could not wait to finish...
""
Do you have any idea to establish the connection? -
Hi,
From where are you trying to establish the connection ? From your desktop ? If so, do you have the ssh client application installed ?
What OS are you running on ?
What version of Qt ? -
Hi,
From where are you trying to establish the connection ? From your desktop ? If so, do you have the ssh client application installed ?
What OS are you running on ?
What version of Qt ? -
Hi,
From where are you trying to establish the connection ? From your desktop ? If so, do you have the ssh client application installed ?
What OS are you running on ?
What version of Qt ? -
I just remembered something: ssh doesn't take a password from stdin so you can't do it with QProcess.
You should take a look at his stackoverflow post which provides several possibilities.