Transfering Files to server IP and port

2

2

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!

Mason

Posted 2013-06-24T14:10:12.770

Reputation: 50

Do you have permission to write to "path"? Do you have permission to create new subdirectories and/or files in your home directory? – Ƭᴇcʜιᴇ007 – 2013-06-24T14:19:37.607

No I don't, but I tried using someone else's directory that did have those permissions and it still didn't work. – Mason – 2013-06-24T14:21:46.660

Answers

6

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)

arne

Posted 2013-06-24T14:10:12.770

Reputation: 206

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 – 2013-06-24T14:33:42.790

@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) – Darth Android – 2013-06-24T14:44:33.843

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 – 2013-06-24T14:57:11.833

2user = rw /group = r / everyone = r -- what user owns the directory?

Also: /path/destination and path/destination are 2 different things. – MattPark – 2013-06-24T15:23:47.260