本文介绍了nginx + WordPress:SFTP +自动更新是否具有正确的用户/文件权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了指南在Ubuntu VPS上安装nginx和WordPress.本指南指示您将/var/www目录的所有者设置为nginx:nginx.使用SFTP时,我使用名称ubuntu登录,但是该名称无权写入nginx拥有的任何文件.

I used this guide to install nginx and WordPress on a Ubuntu VPS. The guide instructs you to set the owner of the /var/www directory to nginx:nginx. When I use SFTP, I log in with the name ubuntu, but this name doesn't have permission to write any of the files that nginx owns.

我的问题是...什么是执行以下操作的理想方法:

My question is... what would be the ideal way to do the following:

  1. 授予用户ubuntu通过SFTP写入/var/www中文件的适当权限
  2. 保留nginx /var/www的所有者,以便WordPress可以继续自动更新文件
  1. To grant user ubuntu proper permission to write to files in /var/www via SFTP
  2. Keep nginx the owner of /var/www so WordPress can continue to auto-update files

ubuntu添加到nginx组会如此简单吗?我关心的是安全性,我想知道实现上述目标的最安全方法是什么.

Would it be as simple as adding ubuntu to the nginx group? My concern is security, and I'm wondering what would be the most secure way of accomplishing the above.

推荐答案

您可以在/etc/php5/fpm/pool.d/*.conf中添加新的(或编辑已存在的www.conf)php池,以便与任何用户+组模拟. 例如.

You can add new (or edit existed www.conf) php pool here /etc/php5/fpm/pool.d/*.conf to work with any user+group impersonation. For example.

这篇关于nginx + WordPress:SFTP +自动更新是否具有正确的用户/文件权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 05:47