Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I see the list of files open in a directory by other users? I can do "lsof +D", but that only shows current user's files. Any way to see if other users have opened files in a directory?

share|improve this question

2 Answers 2

You can't unless you are performing this as root.

If you wanted, you can setup an sudo alias for lsof, but it would either be very generic (i.e. this user can see the whole lsof output) or very specific (this user can only see this other user's lsof -u user output).

share|improve this answer

i assume you run as root / can sudo as root lsof:

lsof -u www-data
share|improve this answer
    
Nope, the user that's running lsof isnt (cannot be) root. However he does have rwx access to the dir and files the other user is writing to –  Ash Nov 23 '09 at 9:03
    
@Ash - so user cannot. you can suid lsof or allow user to run it as root via sudo. but those are not good ideas. user needs to have access to /proc/processnumber to check current working dir for processes run by others. just read access to his home folder is not enough. –  pQd Nov 23 '09 at 11:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.