<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Wordpress_security</id>
	<title>Wordpress security - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Wordpress_security"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Wordpress_security&amp;action=history"/>
	<updated>2026-04-21T05:14:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Wordpress_security&amp;diff=4350&amp;oldid=prev</id>
		<title>Busk: Created page with &quot;# File Permissions  https://gist.github.com/macbleser/9136424 ``` #!/bin/bash # # This script configures WordPress file permissions based on recommendations # from http://code...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Wordpress_security&amp;diff=4350&amp;oldid=prev"/>
		<updated>2023-07-01T17:00:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;# File Permissions  https://gist.github.com/macbleser/9136424 ``` #!/bin/bash # # This script configures WordPress file permissions based on recommendations # from http://code...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;# File Permissions&lt;br /&gt;
&lt;br /&gt;
https://gist.github.com/macbleser/9136424&lt;br /&gt;
```&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# This script configures WordPress file permissions based on recommendations&lt;br /&gt;
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions&lt;br /&gt;
#&lt;br /&gt;
# Author: Michael Conigliaro with tweaks to make it faster and SE Linux by Jonathan Gittos&lt;br /&gt;
#&lt;br /&gt;
# check if this script has been called with a first parameter and use it as the wordpress root directory&lt;br /&gt;
[  -z &amp;quot;$1&amp;quot; ] &amp;amp;&amp;amp; WP_ROOT=$PWD || WP_ROOT=$1&lt;br /&gt;
# check owner and group of wp-config and use later to give same to rest of WP DIR unless parameter 2 or 3 set&lt;br /&gt;
[  -z &amp;quot;$2&amp;quot; ] &amp;amp;&amp;amp; WP_OWNER=&amp;quot;$(ls -ld $WP_ROOT/wp-config.php | awk '{print $3}')&amp;quot; || WP_OWNER=$2&lt;br /&gt;
[  -z &amp;quot;$3&amp;quot; ] &amp;amp;&amp;amp; WP_GROUP=&amp;quot;$(ls -ld $WP_ROOT/wp-config.php | awk '{print $4}')&amp;quot; || WP_GROUP=$3&lt;br /&gt;
&lt;br /&gt;
# Make sure we're in what looks like a WP directory to avoid big snafus&lt;br /&gt;
&lt;br /&gt;
if [ ! -f $WP_ROOT/wp-config.php ]; then&lt;br /&gt;
    echo &amp;quot;&amp;quot;&lt;br /&gt;
    echo &amp;quot;--------------------------------------------&amp;quot;&lt;br /&gt;
    echo &amp;quot;This doesn't look like a Wordpress directory!&amp;quot;&lt;br /&gt;
    echo &amp;quot;Current or chosen directory is &amp;quot; $WP_ROOT&lt;br /&gt;
    echo &amp;quot;Maybe change directory, or specify a directory as a parameter to this script and try again?&amp;quot;&lt;br /&gt;
exit&lt;br /&gt;
&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo -e &amp;quot;\nAbout to reset permissions on:\n &amp;quot; $WP_ROOT&lt;br /&gt;
echo &amp;quot;Changing owner and group to:&amp;quot; $WP_OWNER $WP_GROUP&lt;br /&gt;
&lt;br /&gt;
read -p &amp;quot;Does that look right? &amp;quot; -n 1 -r&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
if [[ $REPLY =~ ^[Yy]$ ]]; then&lt;br /&gt;
&lt;br /&gt;
    echo -e &amp;quot;\nRestoring permissions on: &amp;quot; $WP_ROOT&lt;br /&gt;
&lt;br /&gt;
# reset to safe defaults&lt;br /&gt;
chown -R ${WP_OWNER}:${WP_GROUP} $WP_ROOT;&lt;br /&gt;
chmod -R 644 $WP_ROOT;&lt;br /&gt;
chcon -R system_u:object_r:httpd_sys_content_t:s0 $WP_ROOT;&lt;br /&gt;
find ${WP_ROOT} -type d -exec chmod -R 755 {} \;&lt;br /&gt;
&lt;br /&gt;
# allow wordpress to manage wp-config.php (but prevent world access)&lt;br /&gt;
chgrp ${WP_GROUP} ${WP_ROOT}/wp-config.php&lt;br /&gt;
chmod 660 ${WP_ROOT}/wp-config.php&lt;br /&gt;
chcon system_u:object_r:httpd_sys_rw_content_t:s0 ${WP_ROOT}/wp-config.php&lt;br /&gt;
&lt;br /&gt;
# allow wordpress to manage .htaccess&lt;br /&gt;
touch ${WP_ROOT}/.htaccess&lt;br /&gt;
chgrp ${WP_GROUP} ${WP_ROOT}/.htaccess&lt;br /&gt;
chmod 664 ${WP_ROOT}/.htaccess&lt;br /&gt;
chcon system_u:object_r:httpd_sys_rw_content_t:s0 ${WP_ROOT}/.htaccess&lt;br /&gt;
&lt;br /&gt;
# allow wordpress to manage wp-content&lt;br /&gt;
chmod -R 664 $WP_ROOT/wp-content;&lt;br /&gt;
chcon -R system_u:object_r:httpd_sys_rw_content_t:s0 $WP_ROOT/wp-content;&lt;br /&gt;
find ${WP_ROOT}/wp-content -type d -exec chmod -R 775 {} \;&lt;br /&gt;
echo -e &amp;quot;\nDoing it\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
fi&lt;br /&gt;
```&lt;/div&gt;</summary>
		<author><name>Busk</name></author>
	</entry>
</feed>