Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I thought I could easily copy a tgz from a linux box to a windows box (cygwin) by doing this on the linux box:

nc -vv -l 4444 < file.tgz

And this on the windows box:

nc -vv 10.13.13.2 4444 > file.tgz

But whenever I do that the windows box complains:

10.13.13.2: inverse host lookup failed:  : Operation not permitted
(UNKNOWN) [10.13.13.2] 4444 (?) : Connection timed out

What am I doing wrong?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

It's usually that the socket has been closed already. Try this on the linux one (first):

nc -l -p 4444 -w5 < file.tgz

Then this on the windows box (wihin 5 seconds of the first):

nc -w5 10.13.13.2 4444 > file.tgz

The -w argument sets a timeout on the connection (5 seconds, in this case). Also, -l sets up listen mode, but you need to specify the listen port with -p.

share|improve this answer
add comment

Uh, what exactly are you trying to do? Transfer a file from a Linux box to a Windows box?

I always use WinSCP. It connects to the Linux box's sshd and transfers files over SFTP.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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