transfer - Using psftp to copy files from unix to windows

29
2014-01
  • chris

    I am currently trying to copy a file from a unix server to my local machine. I know you have to use the "get" command but after executing the command, the file is not showing up in my local directory. I really don't know much about unix or psftp so there maybe a chance I am just forgetting something basic. Any ideas?

  • Answers
  • Tillman32

    Here is a psftp tutorial, there is the 'get' and 'put' command, depending on which box your trying to move the file from.

    Honestly, I would download WinSCP, this has a lot more options, would be faster for you, and a lot easier to use. I use this daily, and I love it.


  • Related Question

    Copy file from remote UNIX terminal to local system
  • pineapple

    I use putty on Vista to connect to remote UNIX shell. But I want to copy files from that remote server to my local Vista system. How to do that??


  • Related Answers
  • sanscore

    WinSCP should do the trick. You're not going to be able to do it form putty.

  • Muttley

    If you're using PuTTY and connecting via SSH check if you have pscp installed with PuTTY (or download it from the PuTTY site). Then you can just do:

    pscp user@host:/path/to/file .

  • AKX

    I know it's been a while since this was asked, but I just happened to pull this off fairly easily with a couple utilities without an extra SCP/SFTP session.

    • Set up port forwarding in your SSH session for some remote port portA to forward to some local port portB.
    • Run netcat (or an equivalent such as ncat) on your local machine, making it listen to portB and output to a file:

      nc -l -p portB > output_file
      
    • Run netcat (or, again, an equivalent such as ncat) on the remote host, piping in data however you wish to localhost:portA.

      nc localhost portA -q 1 < my_file
      # or maybe, say, mysqldump --xml ... ... | nc localhost portA -q 1
      
    • The netcats will both exit when the file has been completely received.

    You can of course add a gzip or a pv inbetween. Do remember the connection only accepts one file at a time -- creative use of tar might help.

  • Chris Jester-Young

    Cygwin + scp/ftp?