I want to get the username who modified a file in watched directory in LINUX operating system (UBUNTU).
I am getting notification of modified file in watched directory through inotify
, but I didn't get username who modified.
I used auditctl
for adding same watch directory path which is added in the inotify
and getting information using ausearch
But I am getting whole information about file which is modified in watched directory which is totally not my use.
I want username specifically who recently modified that file which is in the watch directory.
I refer https://github.com/linux-audit/audit-testsuite this for installing and using auditctl
.
My main task is to get username who last modified a particular file, how can I do this?