[opensuse] Address already in use
Dear my friends... I use OpenSuSE11.1. How can I know which TCP port number is being occupied? And how can I know which service is using a certain port number? All I know only turn off the firewall and doing "nmap -PN [FQDN-hostname]". I get this error (in /var/log/mail) as I want to start my postfix: postfix/master[10597]: fatal: bind 127.0.0.1 port 10025: Address already in use Thank you very much in advance. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
In <20091007111908.7519ab63@uni.de>, Ricky Tompu Breaky wrote:
I use OpenSuSE11.1.
How can I know which TCP port number is being occupied? And how can I know which service is using a certain port number? All I know only turn off the firewall and doing "nmap -PN [FQDN-hostname]".
(as root) netstat -tlp OR netstat -tlnp # Avoids translating numbers to names (DNS/services) -- Boyd Stephen Smith Jr. ,= ,-_-. =. bss@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/ \_/
On Tuesday October 6 2009, Ricky Tompu Breaky wrote:
Dear my friends...
I use OpenSuSE11.1.
How can I know which TCP port number is being occupied? And how can I know which service is using a certain port number? All I know only turn off the firewall and doing "nmap -PN [FQDN-hostname]".
You can use the "lsof" command to associate IP addresses and port numbers with the running process(es) that have that address / port open. To see all the IP ports in use with their process IDs (as root): # lsof |egrep IP Limiting it to IPv4: # lsof |egrep IPv4 Limiting it futher to TCP: # lsof |egrep 'IPv4.*TCP' And so on. The process ID is the 2nd column and the program name is the 1st. Piping through grep like that removes the column headers, but you can see them with this: # lsof |head -1
I get this error (in /var/log/mail) as I want to start my postfix: postfix/master[10597]: fatal: bind 127.0.0.1 port 10025: Address already in use
Thank you very much in advance.
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
In <200910062151.41088.rschulz@sonic.net>, Randall R Schulz wrote:
On Tuesday October 6 2009, Ricky Tompu Breaky wrote:
How can I know which TCP port number is being occupied? And how can I know which service is using a certain port number? All I know only turn off the firewall and doing "nmap -PN [FQDN-hostname]".
You can use the "lsof" command to associate IP addresses and port numbers with the running process(es) that have that address / port open.
To see all the IP ports in use with their process IDs (as root):
# lsof |egrep IP
lsof -i
Limiting it to IPv4:
# lsof |egrep IPv4
lsof -i4
Limiting it futher to TCP:
# lsof |egrep 'IPv4.*TCP'
lsof -i4tcp
And so on.
man 8 lsof
The process ID is the 2nd column and the program name is the 1st. Piping through grep like that removes the column headers, but you can see them with this:
# lsof |head -1
Wow. You do know that lsof has a multitude of ways to limit the output itself, so that you get just IP, just IPv4, or just TCP connections AND the headers output from a single command-line, without needing as second utility. If there was a useless use of grep award you would have just won it. -- Boyd Stephen Smith Jr. ,= ,-_-. =. bss@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/ \_/
On Wednesday 07 October 2009 07:32:46 am Boyd Stephen Smith Jr. wrote:
In <200910062151.41088.rschulz@sonic.net>, Randall R Schulz wrote:
On Tuesday October 6 2009, Ricky Tompu Breaky wrote:
How can I know which TCP port number is being occupied? And how can I know which service is using a certain port number? All I know only turn off the firewall and doing "nmap -PN [FQDN-hostname]".
You can use the "lsof" command to associate IP addresses and port numbers with the running process(es) that have that address / port open.
To see all the IP ports in use with their process IDs (as root):
# lsof |egrep IP
lsof -i
Limiting it to IPv4:
# lsof |egrep IPv4
lsof -i4
Limiting it futher to TCP:
# lsof |egrep 'IPv4.*TCP'
lsof -i4tcp
And so on.
man 8 lsof
The process ID is the 2nd column and the program name is the 1st. Piping through grep like that removes the column headers, but you can see them with this:
# lsof |head -1
Wow. You do know that lsof has a multitude of ways to limit the output itself, so that you get just IP, just IPv4, or just TCP connections AND the headers output from a single command-line, without needing as second utility.
If there was a useless use of grep award you would have just won it.
And if there was a useless pedantic post award your name would be engraved upon it. What possible reason would you have for policing how others obtain information without having to know each possible nuance of each possible control? -- __________________________________________________________ Somebody stoled my tag line, so now I have this rental... JSA -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wednesday 07 October 2009 11:42:24 pm jsa wrote:
If there was a useless use of grep award you would have just won it.
perhaps a little too heavy on the sarcasm here. almost everybody using linux is familiar with grep to some extent; lsof is a bit more esoteric, insider knowledge. i'm happy to learn about the options that exist with lsof, but if i was the original poster i'd probably be miffed, too.
And if there was a useless pedantic post award your name would be engraved upon it.
nevertheless, you learned something new and should be grateful. never mind the tone it was delivered in...
What possible reason would you have for policing how others obtain information without having to know each possible nuance of each possible control?
mainly to tell you that there's a more direct way. doesn't make much difference in a single command line command, but if somebody built this into an extensive script that gets called over again or something, it makes sense to do it without unnecessary clutter. -- phani. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wednesday 07 October 2009 01:28:43 pm phanisvara das wrote:
perhaps a little too heavy on the sarcasm here. almost everybody using linux is familiar with grep to some extent; lsof is a bit more esoteric, insider knowledge. i'm happy to learn about the options that exist with lsof, but if i was the original poster i'd probably be miffed, too.
I always chock it up to the old axiom: "There are a-holes in every crowd. The bigger the crowd, the more a-holes you have in it..." No offense to the original poster meant or implied. We all need to remember that people, for the most part, come here for help. And while I may be a crouchy old man who sits on his veranda, I always try to remember that. (now, of course, we all know the devs ain't here to get help ;-) -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wednesday October 7 2009, Boyd Stephen Smith Jr. wrote:
...
Wow. You do know that lsof has a multitude of ways to limit the output itself, so that you get just IP, just IPv4, or just TCP connections AND the headers output from a single command-line, without needing as second utility.
Yes. I knew that but deliberately wanted to waste other people's time typing and CPU and disk power consumption. You got me.
If there was a useless use of grep award you would have just won it.
One takes one's awards where one can get them. Does that come with cash, or just a statuette? (I have this sinking feeling I wont' be hearing from the Nobel committee this year.) RRS -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 08 October 2009 12:05:36 am Randall R Schulz wrote:
On Wednesday October 7 2009, Boyd Stephen Smith Jr. wrote:
...
Wow. You do know that lsof has a multitude of ways to limit the output itself, so that you get just IP, just IPv4, or just TCP connections AND the headers output from a single command-line, without needing as second utility.
Yes. I knew that but deliberately wanted to waste other people's time typing and CPU and disk power consumption.
You got me.
If there was a useless use of grep award you would have just won it.
One takes one's awards where one can get them.
Does that come with cash, or just a statuette? (I have this sinking feeling I wont' be hearing from the Nobel committee this year.)
sorry, i mistook jsa for the original poster. your reply is perfect, of course. -- phani. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wednesday 07 October 2009 13:35:36 Randall R Schulz wrote:
On Wednesday October 7 2009, Boyd Stephen Smith Jr. wrote:
Wow. You do know that lsof has a multitude of ways to limit the output itself.
Yes. I knew that but deliberately wanted to waste other people's time typing and CPU and disk power consumption.
You got me.
LOL. I have been thoroughly rebutted. (As if I wasn't enough of a butt in my first email. ;) )
If there was a useless use of grep award you would have just won it.
One takes one's awards where one can get them.
Does that come with cash, or just a statuette?
It's really just a certificate similar to: http://www.smallo.ruhr.de/award.html or http://partmaps.org/era/unix/award.html -- Boyd Stephen Smith Jr. ,= ,-_-. =. bss@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/ \_/
On Thursday 08 October 2009 12:23:52 am Boyd Stephen Smith Jr. wrote:
It's really just a certificate similar to: http://www.smallo.ruhr.de/award.html or http://partmaps.org/era/unix/award.html
now i understand what you were talking about; that's really funny. -- phani. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, 2009-10-07 at 11:19 +0700, Ricky Tompu Breaky wrote:
Dear my friends...
I use OpenSuSE11.1.
How can I know which TCP port number is being occupied? And how can I know which service is using a certain port number? All I know only turn off the firewall and doing "nmap -PN [FQDN-hostname]".
I get this error (in /var/log/mail) as I want to start my postfix: postfix/master[10597]: fatal: bind 127.0.0.1 port 10025: Address already in use
Thank you very much in advance.
The command (as root) "lsof -i" shows what you want to know... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Ricky Tompu Breaky wrote:
Dear my friends...
I use OpenSuSE11.1.
How can I know which TCP port number is being occupied? And how can I know which service is using a certain port number? All I know only turn off the firewall and doing "nmap -PN [FQDN-hostname]".
I get this error (in /var/log/mail) as I want to start my postfix: postfix/master[10597]: fatal: bind 127.0.0.1 port 10025: Address already in use
In your master.cf your have defined more than one transport, that binds to this address and port. An example would be to use both localhost and all addresses for this port: master.cf: 10025 inet n - n - - smtpd [...] 127.0.0.1:10025 inet n - n - - smtpd The first transport will bind to all addresses on port 10025, the second one tries to bind to port 10025 specifically to localhost. Unfortunately, the first has already snatched that port for all ip addresses, so you get that error message. Solution: Bind the first transport to a specific ip address: master.cf: 1.2.3.4:10025 inet n - n - - smtpd [...] 127.0.0.1:10025 inet n - n - - smtpd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (8)
-
Boyd Stephen Smith Jr.
-
David C. Rankin
-
Hans Witvliet
-
jsa
-
phanisvara das
-
Randall R Schulz
-
Ricky Tompu Breaky
-
Sandy Drobic