Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there anyway to ping a computer's IP and find out some basic information about it? Platform, OS, etc...

If so, how would that be done?

share|improve this question
up vote 3 down vote accepted

Using nmap from MacPorts you can run the following command to attempt to identify the OS of a remote machine:

sudo nmap ipaddress -O


$ sudo nmap localhost -O

Starting Nmap 5.51 ( ) at 2011-08-07 17:58 CEST
Nmap scan report for localhost (
Host is up (0.000085s latency).
Not shown: 989 closed ports
22/tcp   open  ssh
80/tcp   open  http
88/tcp   open  kerberos-sec
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
515/tcp  open  printer
631/tcp  open  ipp
3689/tcp open  rendezvous
5900/tcp open  vnc
8888/tcp open  sun-answerbook
9091/tcp open  xmltec-xmlmail
Device type: general purpose
Running: Apple Mac OS X 10.5.X|10.6.X
OS details: Apple Mac OS X 10.5 - 10.6.3 (Leopard - Snow Leopard) (Darwin 9.0.0 - 10.3.0)
Network Distance: 0 hops

OS detection performed. Please report any incorrect results at .
Nmap done: 1 IP address (1 host up) scanned in 8.80 seconds]
share|improve this answer
And is there a way to include my root password in there so I don't need to enter it on the next line? sudo --password="applemac" nmap localhost -O kinda thing? – JShoe Aug 7 '11 at 16:16
If you run this kind of command regularly, you can create a setuid binary that would run as root without asking for the root password. I'm not sure why you would want to do this, however. – Sören Kuklau Aug 7 '11 at 19:15
A more secure way would be to edit /etc/sudoers and add an entry in the form username ALL=(ALL) NOPASSWD: ALL. Setting the setuid bit allows any user on the system to have sudo access. – grantc Aug 8 '11 at 12:36

WakeOnLan is a GUI based app that can give some of this information. Additionally it scans the network and lists all devices. It doesn't have any success recognizing Linux based machines.

share|improve this answer
That'd be wonderful, if I wasn't trying to make the same thing. :) I'm using these commands to write a GUI in python to show active devices, and if you want, get info. Unfortunately, getting people to install nmap and enter their root password is too much, this'll be just for me. – JShoe Aug 7 '11 at 16:35
You can ship nmap with your GUI, and you can also ship it with a tool with setuid. It would then only have to prompt for the admin password once. – Sören Kuklau Aug 7 '11 at 19:16

Your Answer


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.