Install nmap on Ubuntu,
$ sudo apt-get install nmap
Now, if you know the IP address of the machine whose details you want to know, use that IP in below command, in our case its 192.168.1.105 ( you can replace this, with IP you want )
$ nmap -v -Pn -A 192.168.1.105
Starting Nmap 6.47 ( http://nmap.org ) at 2015-12-02 16:06 IST
NSE: Loaded 118 scripts for scanning.
NSE: Script Pre-scanning.
Initiating Parallel DNS resolution of 1 host. at 16:06
Completed Parallel DNS resolution of 1 host. at 16:06, 0.18s elapsed
Initiating Connect Scan at 16:06
Scanning 192.168.1.105 [1000 ports]
Discovered open port 139/tcp on 192.168.1.105
Discovered open port 135/tcp on 192.168.1.105
Discovered open port 445/tcp on 192.168.1.105
Discovered open port 5357/tcp on 192.168.1.105
Completed Connect Scan at 16:06, 4.76s elapsed (1000 total ports)
Initiating Service scan at 16:06
Scanning 4 services on 192.168.1.105
Completed Service scan at 16:07, 11.06s elapsed (4 services on 1 host)
NSE: Script scanning 192.168.1.105.
Initiating NSE at 16:07
Completed NSE at 16:07, 40.08s elapsed
Nmap scan report for 192.168.1.105
Host is up (0.012s latency).
Not shown: 996 filtered ports
PORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn
445/tcp open netbios-ssn
5357/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-methods: No Allow or Public header in OPTIONS response (status code 503)
|_http-title: Service Unavailable
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| nbstat: NetBIOS name: ADMIN-PC, NetBIOS user: <unknown>, NetBIOS MAC: MACHINE_MAC_HERE (Liteon Technology)
| ADMIN-PC<00> Flags: <unique><active>
| WORKGROUP<00> Flags: <group><active>
| ADMIN-PC<20> Flags: <unique><active>
|_ WORKGROUP<1e> Flags: <group><active>
| OS: Windows 7 Ultimate 7601 Service Pack 1 (Windows 7 Ultimate 6.1)
| OS CPE: cpe:/o:microsoft:windows_7::sp1
| Computer name: admin-PC
| NetBIOS computer name: ADMIN-PC
| Workgroup: WORKGROUP
|_ System time: 2015-12-02T16:07:08+05:30
| Account that was used for smb scripts: guest
| User-level authentication
| SMB Security: Challenge/response passwords supported
|_ Message signing disabled (dangerous, but default)
|_smbv2-enabled: Server supports SMBv2 protocol
NSE: Script Post-scanning.
Read data files from: /usr/bin/../share/nmap
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 57.37 seconds
You can also check Identify all devices in a network using nmap and ARP scan.