Find the answer to your Linux question:
Results 1 to 5 of 5
I'm running ubuntu 8.04 with ssh server. I do the following with putty from my windows machine: 1. connect/login to linux machine with ssh 2. login to sftp, "sftp user1@desktop", ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    84

    SFTP "get" creates another copy on remote machine


    I'm running ubuntu 8.04 with ssh server. I do the following with putty from my windows machine:

    1. connect/login to linux machine with ssh
    2. login to sftp, "sftp user1@desktop", enter password
    3. try to get a file, "get Desktop/testFile"
    4. receive message, "Fetching /home/user1/Desktop/testFile to testFile"

    The file is transferred to another directory on the linux machine, it doesn't get to the windows machine. It is copied from /home/user1/Desktop to /home/user1.

    I tried entering remote directories such as "get Desktop/testFile C:/testFile", but received an error: "Couldn't open local file "C:/testFile" for writing: No such file or directory".

    Command "get Desktop/user1 C:/" resulted in "Couldn't open local file "C:/" for writing: Is a directory".

    Any ideas on transferring the file?

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    I would use a program called WinSCP. It uses the same protocalls (can use scp of sftp), but it presents it in a nice dual pane GUI, and i find it to be alot easier to use. I dont quite know what your trying to move or how your trying to move it, so i can't quite help you with your method of transfer.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Just Joined!
    Join Date
    Jun 2008
    Posts
    84
    I already installed WinSCP and it works properly, it can copy files from the linux machine to my windows comp.

    I just want to know how to do it with putty command line using sftp. The help pages for sftp said issuing the get command would transfer the file but it doesn't.

  4. #4
    Just Joined!
    Join Date
    Jun 2008
    Posts
    84
    I found the problem, I was already logged onto ubuntu from ssh so the local directory was the ubuntu directory. Use a sftp client like psftp, http://the.earth.li/~sgtatham/putty/.../x86/psftp.exe.

    This thread helped me: sftp change local directory - Ubuntu Forums

  5. #5
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    ah, glad you found the solution. I was going to suggest using the scp command line tool from the putty guy if you wanted command line, but since you found a solution, good on you.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

Posting Permissions

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