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

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 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器