[Bug 3940] New: [Patch] Add ScpProtocol ssh_config directive for legacy SCP fallback

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Apr 1 10:18:08 AEDT 2026


https://bugzilla.mindrot.org/show_bug.cgi?id=3940

            Bug ID: 3940
           Summary: [Patch] Add ScpProtocol ssh_config directive for
                    legacy SCP fallback
           Product: Portable OpenSSH
           Version: 10.2p1
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: scp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: luizluca at gmail.com

Created attachment 3952
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3952&action=edit
Suggested patch to implement scp protocol option in config

Recent versions of OpenSSH transitioned scp to use the SFTP protocol by
default. When interacting with embedded systems (such as OpenWrt) or
legacy environments where the sftp-server subsystem is unavailable or
not installed, users must manually append the -O flag to every scp
command to force the legacy protocol.

Currently, there is no way to abstract this requirement via ssh_config
like we do for other host-specific quirks, making the daily workflow
cumbersome for users who regularly interact with these systems.

This patch introduces a new ScpProtocol directive in ssh_config,
allowing users to persistently define the desired file transfer
protocol (sftp or scp) on a per-host basis.

When a user executes scp without explicit protocol flags, the client
queries the configuration for the remote host(s) via a lightweight ssh
-G call. If any of the remote hosts involved in the transfer (source or
destination) have ScpProtocol scp configured, the scp client
automatically falls back to MODE_SCP for the session.

The full patch generated via git format-patch is attached to this
ticket.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list