i want to transfer file from unix server to windows 2003 server i download copssh on windows 2003 and openssh is already installed in unix ... i execute the following command :- scp -r /file_in_unix/ user@windows_hostname:\c:\\

the following output appear in unix screen :-

100% |***************************************************************| 562 00:00

but when i go to see file in c drive i don't find anything :(

link|improve this question

67% accept rate
Belongs on superuser.com – Paul R Oct 4 '10 at 10:16
Have you used Windows' search functionality to locate the file you copied? Maybe it is there but not in the location where you look? – Olfan Oct 6 '10 at 14:15
feedback

migrated from stackoverflow.com Oct 4 '10 at 10:50

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 3 down vote accepted

The destination path looks wrong - to most unix shells the forward slash is an escape character not a path marker, so I'm guessing the file has dropped into the SSH user's home directory with an odd filename.

IIRC copssh is based on cygwin, so what you probably needed to run is:

scp -r /file_in_unix/ user@windows_hostname:/cygdrive/c/

An alternatives to copying to a SSH service on the Windows machine is to use a GUI client like WinSCP on the Windows box to login to the Unix machine and pull the files over that way - though this is not suitable if you are trying to automate the process.

If you have privileged access on the unix machine (i.e. you are, or can become via sudo or similar, root) and have the relevant support installed you could just copy the files onto a Windows share. You don't say what Unix you are using. For Ubuntu and similar checking that support is present and installing it if not can be done with sudo aptitude install smbfs, you can them mount a Windwos share with something like sudo mount -tcifs //11.22.33.44//sharename /mnt/tmp -ousername=WindowsUserName (where 11.22.33.44 is the IP address of the windows machine, depending on your network setup you may be able to refer to the machine by name rather than address). Once you've done that you can just use the basic file management tools (cp, mv, ...) to interact with that Windows share and call umount /mnt/tmp when you are done. You might want to choose a more meaningful mount point name than /mnt/tmp. You can leave the share mounted, of course, if the transfer of the data is to be automated/scheduled. This method does assume that the Unix machine can see the Windows machine's fileshares through any firewall arrangements that may exist between them.

link|improve this answer
feedback

Here is the link that can help you: http://www.davidstclair.co.uk/networking/create-an-nfs-share-with-microsoft-services-for-uni-15.html

link|improve this answer
feedback

Why not install Samba on the Unix box? Then you can map drives between the two systems. Alternatively, I would use psftp (from the putty suite) rather than the command-line scp, since you aren't familiar with it and apparently do not need to script it.

link|improve this answer
feedback

You can also do it the other way round and pull files from the Windows side instead of pushing from the Unix side. Have a look into tools like WinSCP which is a graphical tool for SCP file transfers giving you a choice between the Windows Explorer or Norton Commander look and feel, both of which should be intuitive to you. Once logged in, you can navigate to the files of interest "the Windows way" and drag and drop them to wherever you want them.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.