1

On wsl(ubuntu), I can do scp somefile ubuntu:somepath, and use tab completion for the somepath, as I use keys to ssh.

But I cant do this in reverse. On remote ubuntu I do scp somefile wsl:, and then press tab, it will show -bash: warning: command substitution: ignored null byte in input.

Config on remote ubuntu for host wsl is just using windows ip and windows username. key is added to C:\Users\username\.ssh\authorized_keys and I changed default shell to wsl in windows, using this microsoft guide. That registry key is now C:\Windows\System\wsl.exe. Plus, I can ssh into wsl from ubuntu without password.

Although I can go to wsl and do scp ubuntu:somefile somepath, but it's annoying to open another shell just for a command and then forget to close it.

11
  • Welcome to Super User! The link to the guide you mentioned is broken. Can you edit your question with the proper link? I have a feeling I know what you are doing, though. Feb 17, 2022 at 14:27
  • Thanks for your warm welcome. I edited the link. Feb 18, 2022 at 1:04
  • I planned to test this out myself before suggesting it, but I'm fairy confident that the "setting the shell" option is (at least part of) the problem here. This means that the key handling is being done on the Windows OpenSSH server side, and my understanding is that scp completion requires the agent to be able to communicate with the Linux end of things. I think that configuring ssh as I suggest in this answer will allow the "full chain" communication needed. But again, I haven't confirmed yet. Feb 19, 2022 at 0:12
  • @NotTheDr01ds I will give it a try now Feb 19, 2022 at 1:21
  • 1
    @NotTheDr01ds Yes, it works flawlessly. Feb 22, 2022 at 2:01

0

You must log in to answer this question.

Browse other questions tagged .