Linux – Como identificar o processo que está utilizando uma porta

Em linux, com a opção p do comando netstat podemos identificar qual o processo está utilizando uma determinada porta:

[root@foo~]# netstat -nap |grep 9101
tcp        0      0 0.0.0.0:9101                0.0.0.0:*                   LISTEN      4266/nsrexecd

No exemplo acima, vemos que o processo de PID 4266 chamado nsrexecd está utilizando a porta 9101.

Com o comando ps, vemos mais detalhes do processo:

[root@foo ~]# ps -ef |grep 4266
root      4266     1  0 Aug29 ?        00:00:00 /usr/sbin/nsrexecd
root      9503  9427  0 10:25 pts/2    00:00:00 grep 4266

O processo nsrexecd pertence ao software de backup Networker (mais conhecido como Legato).

Verificando o status do Networker:

[root@foo init.d]# /etc/init.d/networker status
+--o nsrexecd (4266)

Se paralizarmos o Networker, a porta será liberada:

[root@foo init.d]# /etc/init.d/networker stop

[root@foo init.d]# /etc/init.d/networker status
nsr_shutdown: There are currently no running NetWorker processes.

[root@foo init.d]# netstat -nap |grep 9101
[root@foo init.d]#

Para saber como identificar o processo utilizando uma porta de rede no Aix, veja aqui: Aix – Como identificar o processo que está utilizando uma porta

Leia também:

Trackbacks/Pingbacks
  1. UNIX notes » Aix – Como identificar o processo que está utilizando uma porta
Leave a Reply


Wanting to leave an <em>phasis on your comment?

Trackback URL http://www.unixnotes.org/2007/08/30/linux-como-identificar-o-processo-que-esta-utilizando-uma-porta/trackback/
Quem faz

Bem-vindo ao UNIX Notes. Sou Carla Duclos, administradora de sistemas Unix. Aqui compartilho minhas anotações técnicas. Além disso tenho a gastronomia e a fotografia como hobbies.

Saiba mais »

Bad Behavior has blocked 78 access attempts in the last 7 days.