Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I need a way to Identify a windows SBS server, I have a script that mounts a file share on a SBS server, I need the script to positivity identify the server before mounting. It doesn't need to be secure,

My setup is like this :

My machine is on, the server is on, Because were on different subnets I cannot simply check the arp table for the machines mac address.

running Nmap against the server reveals these open ports

Starting Nmap 6.00 ( http://nmap.org ) at 2012-08-01 09:01 BST
Nmap scan report for host.somewhere.local (
Host is up (0.12s latency).
Not shown: 979 closed ports
21/tcp    open  ftp
80/tcp    open  http
119/tcp   open  nntp
135/tcp   open  msrpc
139/tcp   open  netbios-ssn
443/tcp   open  https
445/tcp   open  microsoft-ds
563/tcp   open  snews
1025/tcp  open  NFS-or-IIS
2002/tcp  open  globe
2301/tcp  open  compaqdiag
2381/tcp  open  compaq-https
2910/tcp  open  tdaccess
3389/tcp  open  ms-wbt-server
4443/tcp  open  pharos
6129/tcp  open  unknown
8192/tcp  open  sophos
8193/tcp  open  sophos
8194/tcp  open  sophos
9000/tcp  open  cslistener
10000/tcp open  snet-sensor-mgmt

Nmap done: 1 IP address (1 host up) scanned in 20.70 seconds

The Nmap results show

Nmap scan report for host.somewhere.local (

How did it reslove the name i've tried dig and host but cannot get the name from the IP

The machine runs https can I somwhow check the cert from a bash script? Or is their another way to check the host is actually who I expect it to be?


share|improve this question

Verifying the https-certificate is propably the best idea. IP, MAC and Names can be easyly spoofed.

Look at curl to check https. You need to provide it with the public CA-certificate, too. As far as I remember the default is that it will deny download if the server-certificate does not match the CA.

share|improve this answer

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.