The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

    Joined:
    Feb 8, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    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.

    COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
    httpd 4213 nobody 135w REG 8,3 4890825 12618128 /usr/local/apache/domlogs/mydomain.com-bytes_log

    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.
     
Loading...

Share This Page