Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Removing World Writable Permissions

Posted on 2013-01-08
4
Medium Priority
?
380 Views
Last Modified: 2013-01-09
I need help with creating either an if statement that will look at the $PATH for root and remove any world writable permissions.
0
Comment
Question by:atom_jelly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38755306
for dir in $(echo $PATH | tr ":" " "); do echo chmod -R o-w $dir; done

Or, shorter:

echo chmod -R o-w $(echo $PATH | tr ":" " ")

echo is for a dry run, remove it to actually perform the operations.

Run the above as root.
0
 

Author Comment

by:atom_jelly
ID: 38755360
This works! Thanks just one more question I believe the STIG finding is for any world writable permissions for root's $PATH. So could I put in there chmod -R u+w $dir

Thanks,
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 total points
ID: 38757143
chmod -R u+w ... will make all files/dirs writeable by the owner
0
 

Author Closing Comment

by:atom_jelly
ID: 38760118
Thank you all.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question