linux 使用nginx 权限不够,对于nginx和Linux,有一些关于权限的问题。

I've recently moved to Digital Ocean after using shared hosting for years!

我最近才搬到数字海洋,用了多年的共享主机!

I'm loving the freedom to install and change anything I want, but I'm unclear about some things.

我喜欢安装和改变任何我想要的东西的自由,但是我不清楚一些事情。

I'm using the LEMP stack installed on Ubuntu 12.04.4x64. I've followed This tutorial here to create a separate account "Archer" so I won't have to use the root account all the time.

我正在使用安装在Ubuntu 12.04 4x64上的LEMP栈。我在这里按照本教程创建了一个单独的帐户“Archer”,因此我不必一直使用根帐户。

Even though Archer has admin permissions I still couldn't edit files in the server using SFTP. SSH works, but not SFTP. So I made Archer owner of the folders I wanted to edit. In nginx.conf I changed the user from "www-data" to "Archer"

尽管Archer具有管理权限,我仍然不能使用SFTP编辑服务器中的文件。SSH能够工作,但不能使用SFTP。所以我让Archer的所有者,我想编辑的文件夹。nginx。conf我将用户从“www-data”更改为“Archer”

Now I have a few PHP scripts that save images in my server. They don't have permission to save those images anymore. Cronjobs aren't working either.

现在我有一些PHP脚本可以在服务器中保存图像。他们没有权限保存这些图像。计划不奏效。

I am thinking they are all related and I messed up on something basic. I'd appreciate any and all help in the right direction!

我认为它们都是相关的,我搞砸了一些基本的东西。我希望能在正确的方向上得到任何和所有的帮助!

1 个解决方案

#1

3

I'd suspect a problem with changing the folders/files owner from "www-data" to "Archer", since that seems to be when the problems started. Try changing the owner back to "www-data" and see if that fixes the PHP scripts permissions problems.

我怀疑将文件夹/文件所有者从“www-data”更改为“Archer”的问题,因为这似乎是问题开始的时候。尝试将所有者更改为“www-data”,看看这是否修复了PHP脚本权限问题。

THEN, if the new user Archer can't edit some files, I'd add the Archer user to a group that has permission to edit the files, use a command like usermod -a -G groupName userName (recommended here https://stackoverflow.com/a/7283086/3412074 or you could edit /etc/groups directly )

然后,如果新用户Archer不能编辑某些文件,我将Archer用户添加到具有编辑文件权限的组中,使用usermod -a -G group name命令(建议使用https://stackoverflow.com/a/7283086/3412074或者直接编辑/etc/groups)

Adding Archer to the "www-data" group should work (it seems to be a standard group on Ubuntu-based things)

向“www-data”组添加Archer应该是可行的(它似乎是基于ubuntu的标准组)

sudo usermod -a -G www-data Archer

sudo usermod -a -G www-data Archer

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值