OpenSSH 9.0, released on April 8, 2022, makes SFTP the default file-transfer protocol for the scp command. An automated transfer job can therefore behave differently after a client upgrade even if its command line has not changed. OpenSSH's release notes identify extra filename quoting and remote home-directory paths as compatibility risks. The switch follows a September 2021 notice that described the new default as a future change. [S1][S3]

Start with the filenames in existing scripts. Under the legacy scp/rcp protocol, the remote shell expands filename wildcards, and characters with special shell meanings need extra quoting to avoid being interpreted as commands. SFTP removes that remote-shell quoting requirement. OpenSSH warns that retaining the old double quoting can cause transfers to fail, and says it will not reproduce that behavior merely for compatibility. The warning concerns the extra quoting for the remote shell; it is not a direction to strip quotation marks indiscriminately. [S1]

Paths such as ~user/file require a separate check. SFTP has no native way to expand a path relative to another user's home directory. OpenSSH's sftp-server in version 8.7 and later provides an extension called expand-path@openssh.com for that purpose. A new scp client does not establish that the destination server supports the path expansion a script expects. [S1]

Source documents

  1. OpenSSH 9.0 release announcementhttps://www.openssh.com/txt/release-9.0
  2. OpenSSH 8.8 release announcementhttps://www.openssh.com/txt/release-8.8