3

I need to transfer files from my local computer on windows 7 to a server running linux. I access the server with putty through ssh at a specific IPv4 address and port number.

I've attempted using the pscp command from my local computer but was denied access by the server. "Fatal: Network error: Connection refused"

 c:>pscp test.csv userid@**IPv4_Addres***:Port# /path/destination_file_name.

Either the server blocks all pscp attempts from unauthorized users (most likely my laptop included) or I used the command incorrectly.

If you have experience using this command, where exactly will the file get transfered to, I'm assuming that the path destination starts at my home directory in the server.

Also if you have any other alternative methods of transfering the files let me know.

Update 1

I have also tried using WinSCP however I got permission denied for that as well, it looks like the server will not let me upload or save files.

Solved

I had a complete lapse of memory and forgot about sudo (spent too much time with scripts the last 2 months), so I was able to change the permissions to allow external editing. Thanks for all the help guys!

2
  • Do you have permission to write to "path"? Do you have permission to create new subdirectories and/or files in your home directory? Jun 24, 2013 at 14:19
  • No I don't, but I tried using someone else's directory that did have those permissions and it still didn't work.
    – Mason
    Jun 24, 2013 at 14:21

1 Answer 1

8

You've got the command line wrong. It should be

pscp -P <port> test.csv userid@<host>:path/destination_file_name

(see http://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter5.html#5.2)

4
  • That worked great, I get past the initial error and am prompted for my pasword, but still have permission denied for some reason. "pscp: unable to open /directory/test.csv: permission denied"
    – Mason
    Jun 24, 2013 at 14:33
  • @Mason That means you don't have permission to write to /directory/test.csv Make sure you can write to the directory (ls -l / | grep directory) Jun 24, 2013 at 14:44
  • The permissions are "-rw-r--r--" so I should be able edit it as I have r&w permissions. Does this mean that pscp is considered other? I also tried changing the permissions of the file using chmod but I got "Operation not permitted"...guess I'm going to have to go and get myself some more permissions.
    – Mason
    Jun 24, 2013 at 14:57
  • 2
    user = rw /group = r / everyone = r -- what user owns the directory? Also: /path/destination and path/destination are 2 different things.
    – MattPark
    Jun 24, 2013 at 15:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .