In my home local area network,Win10 is 192.168.28.242
,debian is 192.168.28.252
.SSH Server is installed on Win10 ,SSH service is on.I can connect Win10 from debian.
debian@MiWiFi-R4A-srv:~$ ssh [email protected]
Enter into driver F ,list all directories and files in the directory sample
:
C:\Users\hello>f:
F:\>cd sample
F:\sample>dir
Volume in drive F is New Volume
Volume Serial Number is 3AB0-5214
Directory of F:\sample
15/08/2025 16:50 <DIR> .
15/08/2025 16:50 <DIR> ..
15/08/2025 16:04 <DIR> project
23/02/2025 19:17 208,641 sample.png
1 File(s) 208,641 bytes
3 Dir(s) 154,399,633,408 bytes free
I want to download all files and directories in the directory sample
in Win10 remote 192.168.28.242
from 192.168.24.252
,issue the command on 192.168.24.252
(debian):
scp -r [email protected]:"f:/sample" /tmp/sample
scp: realpath f:/sample/: No such file
scp: download "f:/sample/": path canonicalization failed
Add asterisk ( * ) as Wildcard character in the command:
scp -r [email protected]:"f:/sample/*" /tmp/sample
scp: realpath f:/sample/project/: No such file
scp: download "f:/sample/project/": path canonicalization failed
sample.png
Only file sample.png
in the sample
directory downloaded,all files and directories in project
can't be downloaded.
More try.
How can download directory recursively with scp from remote Win10 to linux ?
Note that if i issue the command on 192.168.28.242
(win10 cmd):
scp -r f:\sample [email protected]
No problem,it works fine!
To make this question more clearer in my environment:
Pushing from win10 to linux works fine (to issue command on win10 to push the directory recursively with scp to linux)
scp -r f:\sample [email protected]
Pulling from linux can't work.(to issue command on linux to pull the directory on win10 recursively with scp ),none of them can work:
scp -r [email protected]:"f:/sample" /tmp/sample
scp -r [email protected]:"f:/sample/*" /tmp/sample
scp -r [email protected]:'f:/sample' /tmp/sample
scp -r [email protected]:'f:/sample/*' /tmp/sample
scp -r [email protected]:"f:\sample" /tmp/sample
scp -r [email protected]:"f:\\sample" /tmp/sample