Error while running SCP command

Mar 6, 2012 at 11:49 AM
Edited Mar 6, 2012 at 11:54 AM

Hi, Hopefully someone reads this and provides some clarity. 

If I run the following SSH command from Cygwin it works normally:

scp [user]@[server]:~/[remote folder]/[filename] ./[filename]
or

scp [user]@[server]:~/[remote folder]/[filename] ~/[localfolder]/[filename]

The file is copied to either /home or /home/[localfolder]. But if I run from SSH.net I get the following error message:

Permission denied, please try again.

Permission denied, please try again.

Permission denied (publickey,gssapi-with-mic,password).

I'm guessing it could be because ssh.net is trying to copy the file to some restricted folder. However, I've tried specifying folder for which I do have access while Visual Studio runs as admin with the same result.

If I tell cygwin to copy the file to a different folder in the HDD, the command fails. 

I'm not an expert in SSH, but I'm guessing it's because cygwin doesn't have permission to write to other folders.

Apr 27, 2012 at 4:29 PM

Hello

Could you provide a call stack? Also sample code that emulates what you want to do would be nice.

Thanks

May 2, 2012 at 9:54 AM

Hi, I forgot to close this thread.

SSH.NET includes a class specific for SCP while I was trying to run it as a shell command from the SSH class.

Thanks for following up!