SCP error 'unable to open'

5

So, I set up a SSH server (freeSSH, win7) and can connect to it just fine with PuTTY. I then tried to use pscp to transfer a file (foobar.txt, from client to server). I cd-ed to the dir pscp.exe was in, then did pscp.exe foobar.txt user@IP:C:\Users... and got the response user@IP's password:.

At this I promptly typed in the password, to be met with pscp: unable to open C:\Users...: permission denied. The error for getting the password wrong is different, more specifically; Access denied.

(IP is the remote IP, and C:\Users... is the remote filepath)

Charles Noon

Posted 2014-08-19T01:01:45.620

Reputation: 231

Do you happen to have any spaces in your filepath? pscp seems to hate spaces

– Dmitry Grigoryev – 2017-01-09T16:50:46.607

Answers

1

It may be the case that the directory you're trying to copy to does not have sufficient permissions for user to write to.

  • Is the directory you are copying to under user's home directory on the destination system?
  • Does the destination directory actually exist?
  • What are the permissions of foobar.txt? (user may not be able to access the source file so cannot copy it to destination)

To check file permissions on a Windows system:

  • Right click on the file/folder you want to check
  • Select Properties from the menu
  • Select the Security tab

You should then be able to see the user & group who own the file along with permissions for Everyone.

Note: I don't have enough reputation to comment but hope that these questions will help narrow down the cause.

stuts

Posted 2014-08-19T01:01:45.620

Reputation: 136

This is really a comment and not an answer to the original question. You can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. Please read Why do I need 50 reputation to comment? What can I do instead?

– DavidPostill – 2017-01-05T20:18:29.963

Apologies! I wanted to try and help but didn't have high enough rep... Getting close now though! Happy for this to be removed if it's an issue. – stuts – 2017-01-05T21:39:20.480