LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   SFTP "get" creates another copy on remote machine (https://www.linuxquestions.org/questions/linux-server-73/sftp-get-creates-another-copy-on-remote-machine-673197/)

Shwick 09-29-2008 09:18 PM

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?

chrism01 09-29-2008 09:33 PM

Just use scp (actually in your case that'd be pscp from the MS box).

Shwick 09-30-2008 11:54 AM

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.

I'll try SCP, but I'd rather figure out why sftp isn't working.

Shwick 09-30-2008 08:16 PM

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: http://ubuntuforums.org/showthread.php?t=369221


All times are GMT -5. The time now is 03:48 AM.