1

I would like copy a backup file from image vmware linux to windows but I don't know how to process it?

I tried:

scp /source/backup.tar.gz [email protected]:/c:\ProgrammefilesC:\Documentsand Settings\Admin\MyDocuments

but error and I know that it's not like that, so if you have solutions?

2
  • 3
    You need a SSH server on the Windows box for this to work. The most easy way would probably be to do the reverse: Install (start/unblock port) the SSH server on the Linux machine and transfer the file with a Windows client like Putty.
    – Eike
    Aug 18, 2010 at 17:04
  • This would be a great question for superuser. Aug 18, 2010 at 17:08

5 Answers 5

1

Why not just add MyDocuments as a shared folder with your VM? That would simplify things a lot.

Regardless, you need something like WinSCP on your Windows box or else there's nothing to really ssh to.

1
  • Yes think you, if i want that it be include in my script who will be execute automatically ??? Because i have my script ".sh" who make a backup and compress this backup and at the end of my script i would to copy this compress file to a windows folder. I think with the scp command.
    – user46745
    Aug 19, 2010 at 11:22
1

No! You can't use "scp" command to copy date remotely from Linux box to Windows box. You need to install "WinScp" utility on windows machine and then transfer the data from Linux box to windows box.

You can download WinScp from : https://winscp.net/eng/download.php

0

If you can SSH into your linux VM, you have another option.

I use Cygwin on Windows.

You can use this SSH command to copy a file from the VM to your Windows box.

ssh HOST "cat < REMOTEFILE" > LOCALFILE

It also works on binaries.

2
  • Curious, why would you do it this way instead of using scp? If you can install ssh in cygwin, you could also install scp. Oct 18, 2013 at 14:31
  • Using this way is more interesting and fun to me haha. It primarily stemmed from using nc and transferring files between two servers. And also using bash socket programming to transfer files as well. Then, I wanted to do it more securely. Rather than hashing and salting the stream before sending it over nc or bash, SSH just seemed easier, since every linux server has SSH pretty much by default. So, I use SSH over SCP because it's more fun to me.
    – naisanza
    Oct 19, 2013 at 17:02
0

To copy a file from Linux to Windows, you can use the following command from Windows (no Windows SSH server required):

scp user@ip:/dir1/dir2/file "D:\dir1\dir2"
-1

Yes think you, if i want that it be include in my script who will be execute automatically ???

Because i have my script ".sh" who make a backup and compress this backup and at the end of my script i would to copy this compress file to a windows folder.

I think with the scp command.

1
  • scp needs to talk to an ssh server on the remote end. Aug 19, 2010 at 10:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .