SCP in SFTP mode

Damien Miller djm at mindrot.org
Fri Jan 28 11:38:48 AEDT 2022


On Thu, 27 Jan 2022, Dmitry Belyavskiy wrote:

> Hello,
> 
> When we use scp in sftp mode to copy folder to the machines with the "old"
> version of ssh, we get the following error:
> ======
> $ scp -vvv -r test/ touser at machine:/home/touser

What version of OpenSSH are you using? There are a bunch of fixes in git
HEAD after 8.8.

> If I understand correctly, the failure is caused by the lack of the "
> expand-path at openssh.com"
> extension to sftp protocol in old releases and (lack of) processing it on
> the server side.

No, that extension is only invoked when a ~-prefixed path is used.

AFAIK this was juat a behaviour difference: scp in sftp mode wasn't
creating the destination directory if it didn't exist, whereas legacy
scp would do so. It was fixed in the commit you identify below.

> For the recent version self-compatibility it was fixed in
> https://github.com/openssh/openssh-portable/commit/ac7c9ec894ed0825d04ef69c55babb49bab1d32e

-d


More information about the openssh-unix-dev mailing list