Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I determine all files and folders that given user can write to? The user is nobody. Some script in bash or python, perhaps? I'm using Ubuntu 11.04

share|improve this question

1 Answer 1

up vote 9 down vote accepted
find / \( -type f -or -type d \) \
  \( \
    \( -user nobody -perm -u=w \) -or \
    \( -group nobody -perm -g=w \) -or \
    -perm -o=w \
  \) \
  -print

This will find all files and directories belonging to nobody that are user writable, or that belong to the group nobody that are group writable, as well as all files or directories that are writable by anyone.

share|improve this answer
1  
GNU find also has a -writable option that tests write access for the user running the find process. So you could do something like sudo -u nobody find / -writable -print. –  jw013 Oct 11 '11 at 22:00

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.