From 1681b770c51b2a5d89b2105a792d7082a41c1583 Mon Sep 17 00:00:00 2001 From: Randall Mason Date: Sat, 2 May 2020 07:24:14 -0500 Subject: [PATCH] Default to using control sockets for SSH persisting 15 minutes This then requires only one auth for SSH each backup. This is convenient if you auth with a password or some key that isn't in root's ssh-agent. If you backup more often than the default ControlPersist (say, in a loop every 10 minutes), you can auth once you start you internet connection and then it will reuse it for every subsequent backup. This is supported since 2004 on the client side for OpenSSH. --- zfstimemachinebackup.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zfstimemachinebackup.perl b/zfstimemachinebackup.perl index 8eb6e6f..6dff738 100755 --- a/zfstimemachinebackup.perl +++ b/zfstimemachinebackup.perl @@ -29,12 +29,12 @@ my %commandlineoption = JNX::Configuration::newFromDefaults( { 'sourcehost' => ['','string'], - 'sourcehostoptions' => ['-C -l root','string'], + 'sourcehostoptions' => ['-C -l root -o ControlMaster=auto -o ControlPath=/tmp/%r@%h:%p -o ControlPersist=15m','string'], 'sourcedataset' => ['','string'], 'sourceenvironment' => ['','string'], 'destinationhost' => ['','string'], - 'destinationhostoptions' => ['-C -l root','string'], + 'destinationhostoptions' => ['-C -l root -o ControlMaster=auto -o ControlPath=/tmp/%r@%h:%p -o ControlPersist=15m','string'], 'destinationdataset' => ['','string'], 'destinationenvironment' => ['"PATH=\$PATH:/usr/local/bin"','string'],