- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Command for checking world-writable access
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2006 01:26 AM
тАО04-10-2006 01:26 AM
I have a script to check world-writable access using the following command:
grep -v "#" /etc/fstab| awk '{print $2}'|grep -E -v "^/tmp$|^/var/tmp$|\.\.$"|xargs -n1 ls -ld|grep "wx "
However, this command is giving me a bug when the ownership of the mount point with "wx" chars as below:
[root@PROD:/opt/soeg/validation/scripts]
# grep -v "#" /etc/fstab| awk '{print $2}'|grep -E -v "^/tmp$|^/var/tmp$|\.\.$"|xargs -n1 ls -ld|grep "wx "
drwxrwxrwx 6 p50adm sapsys 96 Jun 30 2005 /usr/sap/P50
drwxrwxrwx 19 oratwx dba 2048 Oct 21 21:37 /oracle/TWX
drwxrwxr-x 56 oratwx dba 2048 Oct 14 16:59 /oracle/TWX/920_64
drwxr-xr-x 3 oratwx dba 24576 Feb 13 14:00 /oracle/TWX/saparch
drwxr-xr-x 5 oratwx dba 1024 Oct 27 11:21 /oracle/TWX/sapreorg
How can I do a little bit modification on the command, so it only checks for the world-writable permission?
Pls help.
Thanks and Best Regards,
Dewa
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2006 01:40 AM
тАО04-10-2006 01:40 AM
Re: Command for checking world-writable access
If you want to find files with world-writable permissions do:
# find /path -xdev -type f -perm -o+w
The '-xdev' argument prevents crossing mountpoints. If you want you want to brutally search every filesystem, do:
# find / -type f -perm -o+w
Regards!
...JRF...
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2006 01:45 AM
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2006 01:52 AM
тАО04-10-2006 01:52 AM
Re: Command for checking world-writable access
OK, you want mountpoints. How about this:
while read DEV MPT NULL
do
find ${MPT} -xdev -type d -perm -o+w
done < /etc/fstab
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2006 02:28 AM
тАО04-10-2006 02:28 AM
Re: Command for checking world-writable access
Oops, that should be:
while read DEV MPT NULL
do
find ${MPT} -xdev -type d -prune -perm -o+w
done < /etc/fstab
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2006 02:30 AM
тАО04-10-2006 02:30 AM
Re: Command for checking world-writable access
Thanks a lot. It looks ok for me now. Thanks again for your great help.
Best Regards,
Dewa