November 22, 2024, 08:14:42 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: How to Kill particular port  (Read 6387 times)

Offline ishleen

  • New Member
  • Posts: 1
How to Kill particular port
« on: May 29, 2006, 03:01:36 AM »
Hi

I am new to this site,  I am facing a problem relating to ports...., The senerio is like this:

Suppose some user is conneted to my System using some port  like 7650
I can check it using
#netstat -a

I want to disconnect that active session, how will I do this??

#ps -aux   tells us the processes  which is running in that System, It doesn't display port no....
 So  How can i know that what all processes are being runned by that praticular port no....?




So ...My simple quetion is that How can I kill that port i.e 7650 so that the user which is connected to My system using that port is disconnected???


I need it urgent..

Regards
Ishleen

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
How to Kill particular port
« Reply #1 on: May 31, 2006, 04:23:24 AM »
You can use dis command to know which PID its using

#netstat -p -e --inet --numeric-hosts

After that kill that pid from Linux using

#kill -9 PID


I m not sure abt it but just give a try.

Gaurav

Offline Shammi

  • New Member
  • Posts: 1
Re: How to Kill particular port
« Reply #2 on: October 08, 2008, 08:32:08 AM »
try
netstat -tupan | grep (processname | port | pid )