0

My ssh to a host "sees" one file system; my scp sees a different one. How can this be the case, and how can I fix it. e.g.

$ ssh me@otherpc 'ls -l /tmp/media-files.txt'
-rw-r--r-- 1 me me 194399 Apr 28  2022 /tmp/media-files.txt

$ scp me@otherpc:/tmp/media-files.txt /tmp/
scp: /tmp/media-files.txt: No such file or directory
  • Does your `scp` use SCP or SFTP? (See "History …" [here](https://superuser.com/a/1733992/432690).) What happens when you try `scp -O …`? – Kamil Maciorowski Nov 06 '22 at 20:29
  • "unknown option -- O" – Kevin Kleinfelter Nov 06 '22 at 20:32
  • SCP then. (1) When posting the question, did you copy from your console? or did you type the "code block" anew? If the latter then double-check `-` vs `–` etc. in the commands you have actually used in the console. (2) Use `scp -v …`. What is the line that starts with `debug1: Sending command:`? (3) What is the output of `scp me@otherpc:'; ls -l /tmp/media-files.txt >&2' /tmp/`? – Kamil Maciorowski Nov 06 '22 at 20:44

1 Answers1

1

It turns out that 'otherpc' is running WSL2 and Windows' OpenSSH. otherpc's OpenSSH is configured to launch WSL's bash as the shell on login, so that explains why ssh see's the WSL file system.

But connecting via scp appears to be hard-wired to run the OpenSSH scp as a server, rather than WSL's. So scp "sees" the Windows file system.