Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[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



  • 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).



  • 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.


Log in to reply