Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Among some other servers installed in my Ubuntu system, one is the dictd server. The documentation says it uses port 2628. Running

sudo nmap 192.168.1.74 -p 0-9000

results in:

Nmap scan report for 192.168.1.74
Host is up (0.000010s latency).
Not shown: 8995 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
3128/tcp open  squid-http

It does not list port 2628 used by dictd server (which is up, I checked with ps.) I don't know what's wrong with the command that I used!

My question is how can I list all servers (like dictd and others including some games serves) along with their port numbers? (preferably using console tools)

share|improve this question
    
Only I can say is to try with netcat. command: netcat -z -n -v -w 1 192.168.1.74 1-9000 2>&1 | grep succeeded. Netcat will try to make connection and if service run you will see –  2707974 Mar 26 at 8:44
    
@2707974 that gives the same ports as listed above with nmap.. –  rusty Mar 26 at 8:53
    
dictd work on tcp port by default, I think. Try to scan udp ports nc -vvzu 192.168.1.74 1-9000 -w 1 –  2707974 Mar 26 at 8:57
    
no positives with udp ports either.. –  rusty Mar 26 at 9:07
1  
If service work and use tcp must be in LISTEN state because waiting for connection. netstat -l, must see it. –  2707974 Mar 26 at 9:26

1 Answer 1

This task is what the netstat tool is for. Nmap is a great port scanner, but the kernel is more authoritative, since firewalls can block a port scan.

share|improve this answer

Your Answer

 
discard

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.