1

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.
enter image description here

enter image description here
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
0

1 Answer 1

1

Works for me:

  • Windows 11 Pro (24H2) running its built-in ssh server
  • Debian "bookworm" on a Pi as the client

Command:

scp -r Me@WINDOWS:'e:/temporary/bin' /tmp/bin

ls -l /tmp/bin | wc -l
53

My source directory contains files and one directory, also containing a number of files.

Notes:

  • It also works if I use /e:/temporary/bin as the source path.
  • It also works if I use scp -Or … to fallback to the older SCP protocol rather than SFTP.
  • This backslash variant also works: scp -Or Me@WINDOWS:'e:\temporary\bin' /tmp/bin.
  • This backslash variant does not work: scp -r Me@WINDOWSL:'e:\temporary\bin' /tmp/bin.

Question:

  • In Windows terminology, is your source path - or any part of it - a junction, shortcut, or maybe network share?
1
  • Solved,add argument -O! Commented Aug 16 at 4:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.