Hi,
When I send an nc -z … command from osx 10.9 to osx 10.8, I get no reply.
The app wants to transfer files between a 10.9 and 10.8 via SCP.
But first it verifies if Mac 10.8 is on. It does so namely with the nc -z shell command. Why? because otherwise the app hangs (the colored mouse cursor balloon!).
This is my question: is there any other shell command to verify instantly whether another Mac is online?
Kind Regards,
Payam
What ports are you trying to scan via netcat? Can you paste in the whole command?
Have you seen this Netcat (nc) example? You may not be scanning enough ports perhaps on your remote Mac?
PORT SCANNING
It may be useful to know which ports are open and running services on a
target machine. The -z flag can be used to tell nc to report open ports,
rather than initiate a connection. For example:
$ nc -z host.example.com 20-30
Connection to host.example.com 22 port [tcp/ssh] succeeded!
Connection to host.example.com 25 port [tcp/smtp] succeeded!
The port range was specified to limit the search to ports 20 - 30.
Alternatively, it might be useful to know which server software is
running, and which versions. This information is often contained within
the greeting banners. In order to retrieve these, it is necessary to
first make a connection, and then break the connection when the banner
has been retrieved. This can be accomplished by specifying a small
timeout with the -w flag, or perhaps by issuing a "QUIT" command to the
server:
$ echo "QUIT" | nc host.example.com 20-30
SSH-1.99-OpenSSH_3.6.1p2
Protocol mismatch.
220 host.example.com IMS SMTP Receiver Version 0.84 Ready
Thanks Mike. It is port 22.
But I think the problem is a bug with Apple. As you pointed out, you should get the keyword ‘succeeded’ if the server is online. But if you send the shell command to osx 10.8 from osx 10.9, you receive no answer.
[quote=88209:@Payam Arzani]Thanks Mike. It is port 22.
Do you get any failure messages at all or just nothing?
Anything like this?
nc: connect to 10.120.113.184 port 22 (tcp) failed: Connection refused
AH Strike that as you stated that above you get No Reply.
I get nothing.
It works between Maverick computers. But it does not work between 10.9 and 10.8.
Are you sure that SSH is enabled on the 10.8 OS?
If so maybe write code to SSH connect to the 10.8 OS and measure the buffer results of getting the SSH password?