Added -J for ssh proxy

This commit is contained in:
Chris de Bruin
2023-02-03 14:27:19 +01:00
parent 71681cb8be
commit 7d95472543
2 changed files with 17 additions and 1 deletions

View File

@@ -9,7 +9,13 @@ module Mrsk::Commands
end
def run_over_ssh(command, host:)
"ssh -t #{config.ssh_user}@#{host} '#{command}'"
ssh_command = "ssh"
if config.ssh_proxy
ssh_command << " -J #{config.ssh_proxy.jump_proxies}"
end
ssh_command << " -t #{config.ssh_user}@#{host} '#{command}'"
end
private