# Thread: transfer files over ssh

1. ## transfer files over ssh

Is it possible to transfer files over ssh using putty?

I want to download files from my ubuntu computer at home, using a laptop running win xp. I usually log in to my ubuntu machine on ssh using putty.

Can i transfer files over ssh using putty? If so, how do i do it?

What are the alternatives for this kind of filetransfer?
FTP is kinda obvious, is there any other?

Thanks
Sceiron

2. A Carafe of Ubuntu
Join Date
Sep 2009
Beans
108
Distro
Ubuntu 9.04 Jaunty Jackalope

## Re: transfer files over ssh

Maybe this helps setting up putty?

http://www.electrictoolbox.com/artic...ons/ssh-putty/

3. ## Re: transfer files over ssh

on windows you'd use pscp (linux uses scp). pscp should be bundled with putty. its command line and works the same way as the linux scp (pscp is putty's secure copy)

you may find it easier however to use winscp. it's gui, and behaves just like an ftp client.

if you're automating backup and whatnot, you'd want to control pscp from within a .bat file in windows i guess. anyway, the syntax for pscp and scp is:
Code:
pscp copythis tohere
eg to copy test.txt from windows to your linux desktop you'd open a windows command prompt and do:
Code:
pscp c:\path\to\test.txt user@my-ubuntu-machine:/home/user/Desktop/test.txt
likewise, to pull things from ubuntu you'd do:
Code:
pscp user@my-ubuntu-machine:/home/user/Desktop/test.txt test.txt
if you use a different port for ssh than the default you'd add -P number after pscp. the same goes for using it under linux, except its scp not pscp.

4. ## Re: transfer files over ssh

Originally Posted by aeiah
likewise, to pull things from ubuntu you'd do:
Code:
pscp user@my-ubuntu-machine:/home/user/Desktop/test.txt test.txt
if you use a different port for ssh than the default you'd add -P number after pscp. the same goes for using it under linux, except its scp not pscp.
I belive this is excatly what i'm looking for. Had to install putty tools for it to use the pscp command. However, when i performed the above command the file ended up in my /home directory on the remote machine (Ubuntu). How to i transfer it to my client(xp), do i have to specify localhost somehow?

5. ## Re: transfer files over ssh

This also depends some on how you're copying files. If you're copying a deep directory structure, you might want to something like this:

Code:
tar zcvf - ./deep_directory | ssh user@remote.machine tar zxvf -
This approach also has an advantage when you're trying to copy files to a machine that you can't directly access (on the other side of a firewall, for instance):

Code:
tar zcvf - ./deep_directory | ssh -t user@border.machine ssh user@behind.firewall tar zxvf -
Note: I haven't tested the second of these, it might need a little tweaking.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•