Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tbot/machine/connector/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
4 changes: 4 additions & 0 deletions tbot/machine/linux/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down