Add keep alive option

master
Michael Zanetti 2021-06-28 14:34:18 +02:00
parent 56c0c5b3c3
commit b540b578a8
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,7 @@ void IntegrationPluginReverseSsh::confirmPairing(ThingPairingInfo *info, const Q
process->setArguments(arguments);
arguments.replace(1, "xxxxxx");
qCInfo(dcReverseSsh()) << "Testing SSH connection:" << process->program() << arguments.join(" ");
qCDebug(dcReverseSsh()) << "Testing SSH connection:" << process->program() << arguments.join(" ");
typedef void (QProcess:: *finishedSignal)(int exitCode, QProcess::ExitStatus exitStatus);
connect(process, static_cast<finishedSignal>(&QProcess::finished), this, [=](int exitCode, QProcess::ExitStatus exitStatus){
@ -112,6 +112,7 @@ void IntegrationPluginReverseSsh::setupThing(ThingSetupInfo *info)
pluginStorage()->endGroup();
arguments << "-p" << password << "ssh" << "-o StrictHostKeyChecking=no" << "-oUserKnownHostsFile=/dev/null";
arguments << "-o ServerAliveInterval=60";
arguments << "-TN" << "-R" << QString("%1:localhost:%2").arg(remoteOpenPort).arg(localPort) << QString("%1@%2").arg(user, address) << "-p" << QString::number(remotePort);
QProcess *process = new QProcess(thing);
process->setProgram("sshpass");