diff --git a/tbot/machine/connector/ssh.py b/tbot/machine/connector/ssh.py index 7273c14f..db6cb07d 100644 --- a/tbot/machine/connector/ssh.py +++ b/tbot/machine/connector/ssh.py @@ -65,6 +65,16 @@ def ignore_hostkey(self) -> bool: """ return False + @property + def requires_legacy_scp(self) -> bool: + """ + Use the legacy SCP protocol for file transfers instead of the SFTP protocol. + + Forcing the use of the SCP protocol may be necessary for servers that do not + implement SFTP, for backwards compatibility. + """ + return False + @property def use_multiplexing(self) -> bool: """ diff --git a/tbot/machine/linux/copy.py b/tbot/machine/linux/copy.py index 229e0eb2..7e0f2a21 100644 --- a/tbot/machine/linux/copy.py +++ b/tbot/machine/linux/copy.py @@ -31,6 +31,10 @@ def _scp_copy( *[arg for opt in ssh_config for arg in ["-o", opt]], ] + use_legacy_protocol = getattr(remote_path.host, "requires_legacy_scp", False) + if use_legacy_protocol: + scp_command += ["-O"] + if use_multiplexing: multiplexing_dir = local_host.workdir / ".ssh-multi" scp_command += ["-o", "ControlMaster=auto"]