From b540b578a8a1f0bc3270f5026ebdd989bbdd46e8 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 28 Jun 2021 14:34:18 +0200 Subject: [PATCH] Add keep alive option --- reversessh/integrationpluginreversessh.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reversessh/integrationpluginreversessh.cpp b/reversessh/integrationpluginreversessh.cpp index a3d7c7db..b7e0fe7b 100644 --- a/reversessh/integrationpluginreversessh.cpp +++ b/reversessh/integrationpluginreversessh.cpp @@ -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(&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");