2

I have connected to a Unix server using SSH from my terminal from my Windows client.

How do I copy files from the Unix server to the Windows client? Can I use the scp and rcp commands? Or are there other ways to do so?

10
  • I think it belongs to superuser.com
    – RageZ
    Nov 16, 2009 at 3:47
  • 3
    congrats on the baby windows client! Nov 16, 2009 at 3:48
  • @Dan: ?????? I didn't got it.
    – RageZ
    Nov 16, 2009 at 3:52
  • 4
    "But i am having a windows client" as in "But i am having a baby". Crikey, humor shouldn't need to be explained :-)
    – paxdiablo
    Nov 16, 2009 at 3:54
  • @pax & dan: sorry arf that's a good joke! but I am not native English speaker so kind of difficult to get that kind of joke!
    – RageZ
    Nov 16, 2009 at 3:56

4 Answers 4

10

scp is the way that we do this. If you're using something like putty, it comes with pscp as part of it.

I prefer pscp over the standard scp since it allows you to specify a password on the command line, something useful for scripting.

An example invocation from one of my scripts (details changed to protect the innocent):

pscp -pw paxpwd src.tar.gz [email protected]:/usr/pax/tmp/src.tar.gz

This copies the src.tar.gz file from my local (Windows) directory to /usr/pax/tmp on my pax.com UNIX machine, using the pax/paxpwd user and password.

Your particular use case would be satisfied by:

pscp -pw biranchipwd [email protected]:abc/xyz.txt xyz.txt

Keep in mind that placing passwords into scripts is not generally a good idea since it means anyone that breaks into your local machine can easily break into the other machine as well.

5
  • i accept your answer, can u please write the syntax for it. Say i have a file xyz.txt in my unix server under abc folder.I want to copy it to my windows desktop.
    – Biranchi
    Nov 16, 2009 at 3:56
  • @biranchi: you do the reverse from your windows machice get/put whatever file. It won't be possible to copy from your unix box, since your windows box doesn't have a ssh server.
    – RageZ
    Nov 16, 2009 at 3:58
  • @Biranchi, see the update for a sample command on the Windows side. @RageZ, if you install Cygwin, there's an ssh deomon that you can run but I'd still suggest just using the client on Windows and server on UNIX.
    – paxdiablo
    Nov 16, 2009 at 4:12
  • @pax; you are right you can run sshd on windows but more easy to use the unix server since it's already there ^^
    – RageZ
    Nov 16, 2009 at 4:15
  • @RageZ: I am using putty to ssh to my unix server.
    – Biranchi
    Nov 16, 2009 at 4:17
2

you should check SFTP. Filezilla is able to handle SFTP session. also putty provide a pscp command.

0
0

You can use scp directly on the command prompt itself: For example:

c:>scp [email protected]:/home/myuser/test.properties .

[email protected]'s password:

test.properties 100% 675 0.7KB/s 00:00

2
  • @techzen: did you read his question ? last time I checked there was no scp command on the windows distro ...
    – RageZ
    Nov 16, 2009 at 3:55
  • Eek! And s?he's writing to the root of the C: drive. Where you shouldn't even have write permissions, usually. That'd be, like, telling UNIX users to download files somewhere to /
    – Joey
    Nov 16, 2009 at 6:35
0

Check out WinSCP for a free GUI SFTP client if you don't want to bother with the command line.

You must log in to answer this question.