codeplea/Hands-On-Network-Programming-with-C

ssh_download failed on Windows 10

Closed this issue · 7 comments

when I run the "ssh_download.exe localhost 22 username" command in cmd.exe, I try to download the test.txt that I have created in advance. But ssh_scp_pull_request() failed. Then I try to use the absolute path, it still failed. I promise that the test.txt is existing in that path.
bug
bug1
bug2
I don't know the reason.

In your screenshot, where is the text "Remote command to execute" coming from? Did you modify the program? After the chdir, can you make it list the directory's contents?

Are you sure you have permissions on the file your are requesting? Are you able to successfully download your test file using another program, such as WinSCP?

I modify the ssh_auth.c. Add the ssh_command.c's code in it. I can run the remote command success, such as dir, chdir. ipconfig

etc.

WinSCP use the fSFTP protocol is successfully connect. However, use the SCP protocol is failed.

success

failed

failed2

When you run the dir command over ssh, what does it return?

If WinSCP cannot download the file over SCP, then it seems that the issue is with your server configuration.

I use the default configuration. I don't know how to configuration the sshd_configure. (path: C:\ProgramData\ssh).
when I run dir, it return the directory.

I have not worked with OpenSSH server on Windows, but this makes it appear that SCP must be specifically enabled: https://www.georgiasoftworks.com/ssh-server-windows/faq/how-to-enable-ssh-scp

This registry key is not existing on my local system.