This project is read-only.

Error while running SCP command

Mar 6, 2012 at 12:49 PM
Edited Mar 6, 2012 at 12:54 PM

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]

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

The file is copied to either /home or /home/[localfolder]. But if I run from 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 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 5:29 PM


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


May 2, 2012 at 10: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!