1

I want to copy file from my server to my laptop. but i want to do this with putty. I can do this with filezilla. but i really want to acces with command line. i am not able to copy file from sever to my local computer with command line.

i tried with scp command but uble to copy the file. i am not able to copy file from server.

pls help me in copying the files from my server to my local machine having windows10 installed through command line.

"scp username@source:/location/to/file username@destination:/where/to/put"

i have tried this command but pls guide me what should in write in user@destination.

Rishabh Bahukhandi
  • 135
  • 1
  • 1
  • 11
  • I suggest removing Windows 10 from the Headline, as this behaviour of ssh is expected and universal to all OS's. Your question boils down to "Howto transfer files via ssh" – krysopath Jun 24 '16 at 09:19
  • Possible duplicate of [How to download a file from my server using SSH (using PuTTY on Windows)](http://stackoverflow.com/questions/22127092/how-to-download-a-file-from-my-server-using-ssh-using-putty-on-windows) – Martin Prikryl Jun 24 '16 at 09:20

1 Answers1

-1

If you have a working scp binary on your local machine and want to save a file locally, then you do:

scp user@remote:/path/to/file /destination/path

If you want to upload a local file to the remote, you switch the arguments to scp:

scp /source/path user@remote:/path/to/destination

where /destination/path is a valid, writeable and local path scp works just like cp in this regard.

If you want to go full syntax overload you need a running openssh on your destination(localhost) host, then with it accepting connections to 127.0.0.1, it maybe possible to

scp user@remote:/path/to/file $USER@localhost:/destination/path to get a file from remote

IMHO But this is unnecessary. Perhaps impossible. scp Needs only a valid path (i.e. without user@host) as either source or destination.

As the developer of WinSCP said in his comments, it may be overkill to install Cygwin for just transfering files. Perhaps you have a narrow usecase and do not want to use the commandline(?), then you could become quite happy with Filezilla or even WinSCP.

But as you ask for commandline help, I came to think you want to explore more of the challenges and possibilities of cli-Interfaces. If thats the case, Cygwin would be a suitable tool, not only for transfering files, but also for replacing Putty with a more powerful and versatile Toolbox.

krysopath
  • 324
  • 4
  • 9
  • There's no `scp` in Windows. – Martin Prikryl Jun 24 '16 at 09:20
  • oh, there is an scp.exe binary in cygwin for example. it just not included by default. I read OP question as "howto transfer files via commandline" He himself gave scp as example to work with. So I dont care about premature downvotes, but are you sure you read his question? He says "with command line" and also aks for help regarding this command he gave an example for. – krysopath Jun 24 '16 at 09:25
  • Sure I read it. The OP obviously try to use `scp` on the PuTTY console, not in Windows. So while using `scp` from cygwin is a solution, your answer to be of any use would have to: 1) State that one has to install cygwin, 2) The `scp` is to be run locally, not remotely. And IMHO installing cygwin is huge overkill for downloading a file from the server. Moreover the question is duplicate and off-topic and such you should not even answer it. – Martin Prikryl Jun 24 '16 at 09:35
  • Yes, maybe I answered in vain, but instead of downvoting, you could be constructive from the beginning. The OP could be clearer and everyone could be smarter and more helpful. As always. I was quite sure he had cygwin already installed, though. Let's let the OP decide, which solution is the most apt for his case. – krysopath Jun 24 '16 at 09:43
  • Sure, to be useful (to SO community, not to the OP), you should have either voted the question to be off-topic or duplicate in the first place. – Martin Prikryl Jun 24 '16 at 09:46