LVsler 2019-07-25 10:58 采纳率: 0%
浏览 741

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?
  • 写回答

2条回答 默认 最新

  • chenyj1305 2021-01-12 14:36
    关注

    解决了吗?我也遇到一样的伪问题。。。

    评论

报告相同问题?

悬赏问题

  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题