On Sunday 05 January 2003 11:21 am, FX Fraipont wrote:
Tom Emerson wrote:
- it's already in use -- make sure nmbd is NOT running and try the "netstat -a --tcp" command -- if the system shows it is "listening" on port 137, then "something else" has the port [track that down!] **potentially** this could be inetd/xinetd
vertigo:/home/fx # netstat -a --tcp Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:netbios-ssn *:* LISTEN
But this does not give me the ports that are being "listened to"
netbios-ssn is port 139 -- to see this, do the netstat command with the switch "-an" instead of just "-a" [the "n" means "no names" or "numbers only"] You can also use "--udp" or "--inet" to show udp-only or "all" socket types respectively -- "I forgot..." the port 137 stuff shows up under UDP [though note in the /etc/services file that port 137 is defined identically for TCP and UDP style sockets]
here's my /etc/services file:
profile 136/tcp # PROFILE Naming System profile 136/udp # PROFILE Naming System netbios-ns 137/tcp # NETBIOS Name Service netbios-ns 137/udp # NETBIOS Name Service
Can I simply disable these?
the fact that they are listed in /etc/services doesn't mean they are "enabled" or disabled -- /etc/services simply maps numbers to "human readable names" To find out [definitavely] what "process" has the port opend, we turn to another command: lsof [list Open Files], with the "-i" switch [show IP related files only -- the command "man lsof" gives full details] [note also you should do this as root] franky:~ # lsof -i :137 -n COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME nmbd 657 root 9u IPv4 2641 UDP *:netbios-ns nmbd 657 root 11u IPv4 2644 UDP 192.168.40.6:netbios-ns franky:~ # lsof -i :139 -n COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME smbd 661 root 9u IPv4 3320 TCP *:netbios-ssn (LISTEN) Note the "-i" parameter can be repeated: franky:~ # lsof -n -i :139 -i :137 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME nmbd 657 root 9u IPv4 2641 UDP *:netbios-ns nmbd 657 root 11u IPv4 2644 UDP 192.168.40.6:netbios-ns smbd 661 root 9u IPv4 3320 TCP *:netbios-ssn (LISTEN) (-n again means "numbers only/no names" -- without it, it looks up the DNS name for the computer at 192.168.40.2, which is long enough to make this example "wrap")