remocolab icon indicating copy to clipboard operation
remocolab copied to clipboard

CreateProcessW failed error:2

Open sasagr opened this issue 4 years ago • 7 comments

Describe the bug C:\Users\sasasa>ssh -o UserKnownHostsFile=/dev/null -o VisualHostKey=yes -oProxyCommand="cloudflared access ssh --hostname %h" -L 5901:localhost:5901 [email protected] CreateProcessW failed error:2 posix_spawn: No such file or directory

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome

sasagr avatar Jan 07 '21 15:01 sasagr

That error looks like SSH tried to run cloudflared but failed. Did you download cloudflared and put it in a directory your PATH environment variable points? If you installed cloudflared correctly, running cloudflared --help on console prints help message.

demotomohiro avatar Jan 08 '21 04:01 demotomohiro

I m not sure I m understanding your point about PATH environment but that's what I did. I downloaded the cloudfared.exe file. I created a config file in .ssh directory with the following text (with the path location of my cloudfare file): Host *.trycloudflare.com HostName %h User root Port 22 ProxyCommand <PUT_THE_ABSOLUTE_CLOUDFLARE_PATH_HERE> access ssh --hostname %h

I did this following an other tutorial about Argo Tunnel. Your ssh command line seems to work fine if I omit the -oProxyCommand="cloudflared access ssh --hostname %h" part. Pls guide me to fix it in order to run your command correctly

sasagr avatar Jan 08 '21 07:01 sasagr

You will find many web sites that explains what is PATH environment variable and how to set it by googling with "PATH environment variable windows". remocolab prints ssh command with all ssh options that are required to connect to the server so that you don't need to edit config file. And remocolab suppose your cloudflared.exe is in one of directories PATH environment variable contains. But ssh options can be configured in both config file and command line parameters. You can learn how to use ssh in following pages. https://man.openbsd.org/ssh https://man.openbsd.org/ssh_config

demotomohiro avatar Jan 08 '21 18:01 demotomohiro

Hi, I have the same problem, also use Chrome on Windows 10, but I set PATH, it doesn't work. url

Thanks

Shuntw6096 avatar Jan 28 '21 12:01 Shuntw6096

It might be a bug of the Windows openSSH. Please try full path to your cloudfared in ProxyCommand option.

https://stackoverflow.com/questions/65059250/ssh-and-scp-failed-with-createprocessw-failed-error2-posix-spawn-no-such-file https://github.com/PowerShell/Win32-OpenSSH/issues/1185

demotomohiro avatar Jan 29 '21 17:01 demotomohiro

It might be a bug of the Windows openSSH. Please try full path to your cloudfared in ProxyCommand option.

https://stackoverflow.com/questions/65059250/ssh-and-scp-failed-with-createprocessw-failed-error2-posix-spawn-no-such-file PowerShell/Win32-OpenSSH#1185

It works, thanks.

Shuntw6096 avatar Feb 01 '21 15:02 Shuntw6096

@Shuntw6096 Hello, I have also this problem, but I can not see the solution, can you help me solve. Thank you.

lmc19970711 avatar Apr 01 '21 00:04 lmc19970711