Re: command to inentify the process that is listening in a port.
On Wed, 2007-04-11 at 14:52 -0400, Bob Johnson wrote: On 4/10/07, Jonathan McKeown [EMAIL PROTECTED] wrote: On Monday 09 April 2007 17:37, Martin Hudec wrote: Siju George wrote: How Do you actually Identify what process is listening on a TCP/IP port? nmap does not usually give the right answer. There should be some command that can be run on the local host for identification right? man lsof 5:35pm [amber] ~# lsof -i @localhost:123 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ntpd552 root 10u IPv4 0xc4c46000 0t0 UDP localhost:ntp Just out of interest, why do so many people recommend lsof, which is a port, when sockstat/fstat are in the base system and seem to cover the same ground? Am I missing something about lsof? Linux systems don't have sockstat, so people who got to FreeBSD via Linux are used to lsof and they tend to continue using it. Same result for those who read the many Linux howto websites. - Bob ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] Ironically, coming from linux I found that FreeBSD netstat doesn't support the -l -4 flags, which is how I found out about sockstat -l4 :) Tom signature.asc Description: This is a digitally signed message part
Re: command to inentify the process that is listening in a port.
On 4/10/07, Jonathan McKeown [EMAIL PROTECTED] wrote: On Monday 09 April 2007 17:37, Martin Hudec wrote: Siju George wrote: How Do you actually Identify what process is listening on a TCP/IP port? nmap does not usually give the right answer. There should be some command that can be run on the local host for identification right? man lsof 5:35pm [amber] ~# lsof -i @localhost:123 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ntpd552 root 10u IPv4 0xc4c46000 0t0 UDP localhost:ntp Just out of interest, why do so many people recommend lsof, which is a port, when sockstat/fstat are in the base system and seem to cover the same ground? Am I missing something about lsof? Linux systems don't have sockstat, so people who got to FreeBSD via Linux are used to lsof and they tend to continue using it. Same result for those who read the many Linux howto websites. - Bob ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: command to inentify the process that is listening in a port.
In the last episode (Apr 11), Bob Johnson said: On 4/10/07, Jonathan McKeown [EMAIL PROTECTED] wrote: On Monday 09 April 2007 17:37, Martin Hudec wrote: Siju George wrote: How Do you actually Identify what process is listening on a TCP/IP port? nmap does not usually give the right answer. There should be some command that can be run on the local host for identification right? man lsof 5:35pm [amber] ~# lsof -i @localhost:123 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ntpd552 root 10u IPv4 0xc4c46000 0t0 UDP localhost:ntp Just out of interest, why do so many people recommend lsof, which is a port, when sockstat/fstat are in the base system and seem to cover the same ground? Am I missing something about lsof? Linux systems don't have sockstat, so people who got to FreeBSD via Linux are used to lsof and they tend to continue using it. Same result for those who read the many Linux howto websites. lsof can also go into more detail about the open handles (can display socket buffer sizes, for example), and has more filtering options. It also has a mode that generates easily machine-parsable output. For simple what's listening on this port questions, though, sockstat does just fine. -- Dan Nelson [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: command to inentify the process that is listening in a port.
On Monday 09 April 2007 17:37, Martin Hudec wrote: Siju George wrote: How Do you actually Identify what process is listening on a TCP/IP port? nmap does not usually give the right answer. There should be some command that can be run on the local host for identification right? man lsof 5:35pm [amber] ~# lsof -i @localhost:123 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ntpd552 root 10u IPv4 0xc4c46000 0t0 UDP localhost:ntp Just out of interest, why do so many people recommend lsof, which is a port, when sockstat/fstat are in the base system and seem to cover the same ground? Am I missing something about lsof? Jonathan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: command to inentify the process that is listening in a port.
On Apr 10, 2007, at 3:00 AM, Jonathan McKeown wrote: On Monday 09 April 2007 17:37, Martin Hudec wrote: Siju George wrote: How Do you actually Identify what process is listening on a TCP/ IP port? man lsof Just out of interest, why do so many people recommend lsof, which is a port, when sockstat/fstat are in the base system and seem to cover the same ground? Am I missing something about lsof? A few weeks ago, I would have recommended lsof simply because I wasn't aware of sockstat. It's only from reading things on this list that I've learned about sockstat. And thanks to your message, I've now learned about fstat. Since learning about sockstat, I haven't used lsof, even though lsof was one of the first things I installed from ports when I set up my system. I don't know if others have different reasons for recommending lsof, but speaking for myself, I simply wouldn't have known better. Cheers, -j -- Jeffrey Goldberghttp://www.goldmark.org/jeff/
Re: command to inentify the process that is listening in a port.
In response to Siju George [EMAIL PROTECTED]: How Do you actually Identify what process is listening on a TCP/IP port? nmap does not usually give the right answer. There should be some command that can be run on the local host for identification right? sockstat -4 Various magical combinations of switches to netstat will get you there as well. -- Bill Moran http://www.potentialtech.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: command to inentify the process that is listening in a port.
Siju George wrote: How Do you actually Identify what process is listening on a TCP/IP port? nmap does not usually give the right answer. There should be some command that can be run on the local host for identification right? man lsof 5:35pm [amber] ~# lsof -i @localhost:123 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ntpd552 root 10u IPv4 0xc4c46000 0t0 UDP localhost:ntp Martin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: command to inentify the process that is listening in a port.
In the last episode (Apr 09), Siju George said: How Do you actually Identify what process is listening on a TCP/IP port? nmap does not usually give the right answer. There should be some command that can be run on the local host for identification right? Try /usr/bin/sockstat or lsof (in ports) -- Dan Nelson [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]