June 16, 2011

amban amban
Lab Rat
76 posts

[SOLVED] ssh connection

 

HI,
I have written a bash script on my linux server and i want to display the resulting output in a dialog->textbrowser (Qt Creator in Windows platform).
I see some posts discussing this issue but i am confused. Isnt there a simple in-built class solution to ssh using user name , password and then start process <QProcess> to grab the output ?

Probable solutions i see otherwise are : libssh, LibQxt

Thanks

2 replies

June 16, 2011

Lukas Geyer Lukas Geyer
Gene Splicer
2074 posts

There is no builtin support for SSH as far as I know, so you probably should pick one of the libraries you suggested (Qxt might be easier to integrate, as it already provides some sort of Qt/QProcess-like interface).

June 16, 2011

amban amban
Lab Rat
76 posts

Hi All,
I fixed my problem temporarily. I had to make sure that i have access to both client/server via passkeys.
And then all the we have to do is something simple as this :

QProcess *proc = new QProcess();

proc->start(“ssh server_name /path/to/shell/script”);
proc->waitForFinished();

QString result=proc->readAllStandardOutput();
ui->textBrowser->setText(result); //writing the result to my text browser

Thanks,
Hope this helps.

 
  ‹‹ Unexpected QList behaviour with nested structures.      How can i get pointer on the widget of current tab in QTabWidget? ››

You must log in to post a reply. Not a member yet? Register here!