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 
3
  • Does your scp use SCP or SFTP? (See "History …" here.) What happens when you try scp -O …? Commented Nov 6, 2022 at 20:29
  • "unknown option -- O" Commented Nov 6, 2022 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/? Commented Nov 6, 2022 at 20:44

1 Answer 1

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.

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.