How do I transfer a file to my server using PuTTY?
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
Solution 1:
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 serverexample.com
as userfred
to the file/tmp/foo
you would type:
pscp c:\documents\foo.txt [email protected]:/tmp/foo
Postscript
The Putty download page lets you download putty.zip
- a complete set of Putty tools or you can just download the tools you need (in which case you might have downloaded putty.exe but not yet have downloaded pscp.exe)
Solution 2:
A solution that doesn't use PuTTY: Connect to server with FileZilla using SFTP to transfer files.
Solution 3:
There's no way to initiate a file transfer back to/from local Windows from a SSH session opened in PuTTY window.
Though the recent versions of PuTTY support connection-sharing.
While you still need to run a compatible file transfer client (the pscp
or the psftp
), no new login is required, it automatically (if enabled) makes use of an existing PuTTY session.
To enable the sharing see:
Sharing an SSH connection between PuTTY tools.
Alternative way, is to use WinSCP, a GUI SFTP/SCP client. While you browse the remote site, you can anytime open an SSH terminal to the same site using the Open in PuTTY command.
See Opening Session in PuTTY.
With an additional setup, you can even make PuTTY automatically navigate to the same directory you are browsing with WinSCP.
See Opening PuTTY in the Same Directory.
(I'm the author of WinSCP)