Operating System - Linux
1827262 Members
2539 Online
109717 Solutions
New Discussion

how to check which process provide service on certain port?

 
SOLVED
Go to solution

how to check which process provide service on certain port?

after my being hacked, i have reinstall my ssh complete for 3.4 version, but ssh can not start, i check the log of /var/log/secure, it said can not bind port 22. i try, it is really, may be Trojan, but i do not know how to check which exec file or process to provide thus service on 22?

could any gentle give me some tips?

frederick
frederick
2 REPLIES 2
Ceesjan van Hattum
Esteemed Contributor
Solution

Re: how to check which process provide service on certain port?

Did you already try 'fuser'?
i.e. fuser -n tcp 22

man fuser:
In order to look up processes using TCP and UDP sockets,
the corresponding name space has to be selected with the
-n option. Then the socket(s) can be specified by the
local and remote port, and the remote address. All fields
are optional, but commas in front of missing fields must
be present:

[lcl_port][,[rmt_host][,[rmt_port]]]

Good luck,
Ceesjan
U.SivaKumar_2
Honored Contributor

Re: how to check which process provide service on certain port?

Hi,
Use lsof in linux
#man lsof

regards,
U.SivaKumar
Innovations are made when conventions are broken