Change CXS scan to automatically change folder permissions from 777 to 755

By default, CXS daily and weekly scans will let you know which directories are world writable (777), but it won’t change these. You need to instruct CXS in the scan options to change these permissions automatically for you. This can be achieved in the daily scan with the following command:

sed -i -e '/options=/ s/w/W/' /etc/cxs/crondaily.conf

This can be achieved in the weekly scan with the following command:

sed -i -e '/options=/ s/w/W/' /etc/cxs/cronweekly.conf

All that these commands do is to replace “w” with “W” in the CXS scan options. This basically instructs CXS to automatically change 777 permissions of folders to 755.