nc (netcat) on Mac OS X 10.8.4 gets stuck

前端 未结 2 1495
暖寄归人
暖寄归人 2021-01-06 07:04

I encountered a little issue while using the nc utility on Mac OS X, a utility i often use as a quick and dirty solution to check if a port is open and what version the daem

2条回答
  •  甜味超标
    2021-01-06 07:24

    I believe you are looking for the -G option. From the man pages:

    -G conntimeout TCP connection timeout in seconds.

    -w is used to set the timeout after connection. -G option is used to set the timeout before connection. This should give you what you want

    nc -n -G 2 -v xxx.xxx.xxx.xxx 22
    

提交回复
热议问题