LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2011, 06:29 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
Find world writable directories.


I m writing a little script to check if a directory is world writable or not.

this is what i have achieved.

Code:
# find /tst -xdev -type d \( -perm -0002 -a ! -perm -1000 \)
this works well for directories who have set as world writable bit on by following.
Code:
chmod 777 /tst
However above code doesn't work for /tmp as it is also world writable.
Please help.
 
Old 05-20-2011, 06:38 AM   #2
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
I guess this would be much easier.

Code:
find /root/Desktop -maxdepth 0 -type d -perm /o+w
The only problem is that above command only checks for world writable directories but how would i add group writable directories too.
I guess this should work
Code:
find /tst -maxdepth 0 -type d -perm /o+w,g+w

Last edited by pinga123; 05-20-2011 at 06:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find root owned world writable files? pinga123 Linux - Newbie 23 10-14-2010 08:30 AM
world writable directory? turbo_acura Linux - Software 8 10-17-2009 08:02 AM
crontab and world-writable directories? wy1z Linux - Security 2 01-25-2008 02:38 AM
World Writable Files ilago Linux - Security 4 10-07-2007 12:21 AM
sendmail world writable directory jbrearley Linux - Software 0 07-01-2004 01:16 PM


All times are GMT -5. The time now is 06:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration