Solved

Removing World Writable Permissions

Posted on 2013-01-08
4
369 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to run my script during boot in rhel 7 14 104
Windows Script Host failed (Access is denied.) error 6 109
Unix Script: Loop over all days of a month 17 88
Parse DNS log 3 53
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

895 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

16 Experts available now in Live!

Get 1:1 Help Now