check-ssh-connection connect as root
The code is :
exec {"check-ssh-connection-by-user-${runasuser}-for-${_primarytag}":
command => "ssh -oStrictHostKeyChecking=no ${sftp_resticserver}",
path => '/usr/sbin:/usr/bin:/sbin:/bin',
user => $runasuser,
subscribe => File["${_backupscript}-${_primarytag}"],
refreshonly => true,
}
No used is provided during the ssh command like ${remoteuser}@${sftp_resticserver}
The remote user can be different from the local $runasuser
.
The romte user is the owner of the data in Restic repository
Edited by Fabien Combernous