Solved

Removing World Writable Permissions

Posted on 2013-01-08
4
367 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
  • 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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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)

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now