admin管理员组文章数量:1415139
What are the most restrictive file permissions I should use if I do not intend to use any of WordPress's auto updating functionality. All the recommendations I find online assume you want WordPress to be able to write to its own files for auto updates...I don't. When an update becomes avalible I manually test it and deploy it using version control (for core as well as plugins and themes) I already added the following to my wp-config.php
define( 'DISALLOW_FILE_MODS', true );
define( 'DISALLOW_FILE_EDIT', true );
define( 'AUTOMATIC_UPDATER_DISABLED', true );
define( 'WP_AUTO_UPDATE_CORE', false );
What are the most restrictive file permissions I should use if I do not intend to use any of WordPress's auto updating functionality. All the recommendations I find online assume you want WordPress to be able to write to its own files for auto updates...I don't. When an update becomes avalible I manually test it and deploy it using version control (for core as well as plugins and themes) I already added the following to my wp-config.php
define( 'DISALLOW_FILE_MODS', true );
define( 'DISALLOW_FILE_EDIT', true );
define( 'AUTOMATIC_UPDATER_DISABLED', true );
define( 'WP_AUTO_UPDATE_CORE', false );
Share
Improve this question
asked Jul 25, 2019 at 4:38
user172433user172433
0
1 Answer
Reset to default 1Generally speaking, if you don't want WordPress to update itself or any plugins, don't give the web server write permissions to any of the WordPress files outside of folders like wp-content/uploads.
You'll need to be careful with this and test thoroughly, though, as some plugins, like WordFence, have folders they need to write to for logs and definition updates.
Example: If your web server user is apache, you could change the file ownership to another user, and set group permissions to the web server.
# Change Ownership of files and folders for entire install
chown -R <youruser>:apache /path/to/wordpress/install
# Make sure you set ownership of files and folders you want WordPress to upload to back to the web server user
chown -R apache:apache /path/to/wordpress/install/wp-content/uploads
# Set file and folder permissions to remove write from group
find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;
find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;
本文标签: securityRestrictive File Permissions
版权声明:本文标题:security - Restrictive File Permissions 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745210765a2647870.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论