1

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?

2 Answers 2

3

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.

1

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.

1
  • 1
    Not all boxes run an sshd, as was the case when I asked this question.
    – dsummersl
    Jun 13, 2016 at 12:21

You must log in to answer this question.

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