This is something that has been bugging me for a while and I always stumble on it trying to remember which form to use I can't find anything in the changelog that looks similar to this having been fixed Downloading: vague@IS-C0HVFBY:~$ /usr/bin/scp root@amodev:"/root/projects/management-packs/XI\ Gridhost.json" . root@amodev's password: XI Gridhost.json vague@IS-C0HVFBY:~$ /usr/bin/scp root@amodev:"/root/projects/management-packs/XI Gridhost.json" . root@amodev's password: scp: /root/projects/management-packs/XI: No such file or directory scp: Gridhost.json: No such file or directory vague@IS-C0HVFBY:~$ /usr/bin/scp "root@amodev:/root/projects/management-packs/XI\ Gridhost.json" . root@amodev's password: XI Gridhost.json vague@IS-C0HVFBY:~$ /usr/bin/scp root@amodev:/root/projects/management-packs/XI\ Gridhost.json . root@amodev's password: scp: /root/projects/management-packs/XI: No such file or directory scp: Gridhost.json: No such file or directory Uploading: vague@IS-C0HVFBY:~$ /usr/bin/scp "XI\ Gridhost.json" admin@remote: admin@remote's password: XI\ Gridhost.json: No such file or directory vague@IS-C0HVFBY:~$ /usr/bin/scp "XI Gridhost.json" admin@remote: admin@remote's password: XI Gridhost.json vague@IS-C0HVFBY:~$ /usr/bin/scp XI\ Gridhost.json admin@remote: admin@remote's password: XI Gridhost.json
Unfortunately this is inherent to the way that scp works: one set of quote expansion is performed by your local shell and another by the remote shell that executes scp. This behaviour is inherited from BSD rcp from ~29 years ago :(
Closing all resolved bug with release of openssh-8.2