Results 1 to 5 of 5

Thread: transfer files over ssh

  1. #1
    Join Date
    Oct 2007
    Beans
    139
    Distro
    Ubuntu 9.10 Karmic Koala

    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
    Confusion will be my epitaph

  2. #2
    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. #3
    Join Date
    Feb 2006
    Location
    uk
    Beans
    Hidden!

    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. #4
    Join Date
    Oct 2007
    Beans
    139
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: transfer files over ssh

    Quote Originally Posted by aeiah View Post
    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?
    Confusion will be my epitaph

  5. #5
    Join Date
    Jul 2007
    Location
    Louisville, KY, USA
    Beans
    36
    Distro
    Ubuntu 9.10 Karmic Koala

    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.

Bookmarks

Posting Permissions

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