QT5.7使用QSsh,无法connecthost,想问下QSsh是否支持SSH2

SshCfg->host = SerialInf->ssh_Host;
SshCfg->port = SerialInf->ssh_Port;
SshCfg->timeout = SerialInf->ssh_Timeout;
SshCfg->userName = SerialInf->ssh_Username;
SshCfg->password = SerialInf->ssh_Password;

qDebug()<<"host:"<<SshCfg->host;
qDebug()<<"port:"<<SshCfg->port;
qDebug()<<"timeout:"<<SshCfg->timeout;
qDebug()<<"userName:"<<SshCfg->userName;
qDebug()<<"password:"<<SshCfg->password;

SshLink = new QSsh::SshConnection(*SshCfg);

connect(SshLink,SIGNAL(QSsh::SshConnection::connected),this,SLOT(sshcon));
connect(SshLink,&QSsh::SshConnection::dataAvailable,[this](const QString & mse){this->ui->textBrowser_Receive->append(mse);});
connect(SshLink,&QSsh::SshConnection::disconnected,[this](){this->ui->textBrowser_Receive->append("SSH disconnect");});
SshLink->connectToHost();
qDebug()<<"SshLink:"<<SshLink->state();

    SshLink:打印结果一直是0,state返回值0表示未连接,但是用SecurityCRT软件选择ssh2连接方式可以连接装置,QSsh是否支持SSh2?
c++
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐