when calling SCP in PuTTY on my Win7 box, it doesn't let me use C:/, but I also have no idea where on my local machine it will look for files by default. None of program directory or user directory worked. For example, I saved file.txt next to PuTTY.exe, and also in C:\Users\Me but calling SCP file.txt file.txt in PuTTY failed both times with

cp: cannot stat 'file.txt'

So, how do I transfer a file to my server using PuTTY?

EDIT: Also, calling SCP file.txt myserver:file.txt gives a similar error: file.txt: No such file or directory

link|improve this question
do you know the full path to your file.txt? do SCP full-path-to-file.txt myserver:file.txt – Shadow_boi Sep 21 '11 at 3:43
Thanks shadow_boi, but that's the problem: using full path means including c:\, which gives me the error ssh: Could not resolve hostname c: Name or service not known – Trindaz Sep 21 '11 at 3:47
1  
I guess you loged into the server using putty and typed in the CP comment as you mentioned above? That is the issue. Now you are at the server, so when you type C: the server doesn't have c drive – Shadow_boi Sep 21 '11 at 4:26
I dont think putty alone can do the job. WinSCP is a nice GUI tool for secure copy of files, Putty works very well for the job also using the command line tool called pscp. – Shadow_boi Sep 21 '11 at 4:28
feedback

migrated from stackoverflow.com Sep 21 '11 at 8:07

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 1 down vote accepted

A solution that doesn't use PuTTY: Connect to server with FileZilla using SFTP to transfer files.

link|improve this answer
feedback

Have you tried something like

pscp -l user1 c:\ftp\picture.jpg slacker1:/home/user1/pics

The manual for Putty suggests

To send (a) file(s) to a remote server:

pscp [options] source [source...] [user@]host:target

So to copy the local file c:\documents\foo.txt to the server example.com as user fred to the file /tmp/foo you would type:

pscp c:\documents\foo.txt fred@example.com:/tmp/foo

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.