Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to list all open files

Discussion in 'General Discussion' started by p_s_p, Sep 14, 2005.

  1. p_s_p

    p_s_p Member

    Feb 8, 2004
    Likes Received:
    Trophy Points:
    I would like to know if there is anyway to view which user on the server has opened which file, presently I know that the 'lsof' command will display all the open files, but I want to view all the files opened by a particular user and from at particular IP, like list only all files that are opened by the user "xyz" on the server and list all the files opened on the server from a specific IP 'x.x.x.x'. Presently the 'lsof' command just shows me the COMMAND as 'httpd' and users as 'root' and 'nobody' for eg.

    httpd 4213 nobody 135w REG 8,3 4890825 12618128 /usr/local/apache/domlogs/

    I would like to view a particular username or IP from which the file is being accessed. This is important because, many a times on my servers I find the hacking scripts uploaded to the /tmp folder and also the ps command list a processes like 'httpd' or 'bind' running, but since the updatedb has yet not run there is no way to know under which user directory the file is placed or from which IP the file is being accessed.

    To make the long story short I would like to know from which IP or user a given file is being accessed.

    Any advice over this would greatly help catching the spammers.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice