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?

dsummersl
  • 206
  • 3
  • 8

2 Answers2

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.

JeffG
  • 1,194
  • 6
  • 18
SmallClanger
  • 9,127
  • 1
  • 32
  • 47
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.

pepoluan
  • 5,038
  • 4
  • 47
  • 72