From b274ba2c0db731ee3042bf671ac5e1cd8ebea091 Mon Sep 17 00:00:00 2001 From: Zaz Brown Date: Fri, 4 Apr 2025 14:38:08 +0100 Subject: [PATCH] preserve file mode over SCP --- salt/client/ssh/shell.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/salt/client/ssh/shell.py b/salt/client/ssh/shell.py index 674e9f075191..9695ff63c087 100644 --- a/salt/client/ssh/shell.py +++ b/salt/client/ssh/shell.py @@ -257,7 +257,9 @@ def _cmd_str(self, cmd, ssh=SSH_PATH): # need to deliver the SHIM to the remote host and execute it there command = [ssh] - if ssh != SCP_PATH: + if ssh == SCP_PATH: + command.append("-p") + else: command.append(self.host) if self.tty and ssh == SSH_PATH: command.append("-t -t")