linux 使用nginx 权限不够,对于nginx和Linux,有一些关于权限的问题。
I've recently moved to Digital Ocean after using shared hosting for years!
我最近才搬到數(shù)字海洋,用了多年的共享主機(jī)!
I'm loving the freedom to install and change anything I want, but I'm unclear about some things.
我喜歡安裝和改變?nèi)魏挝蚁胍臇|西的自由,但是我不清楚一些事情。
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棧。我在這里按照本教程創(chuàng)建了一個(gè)單獨(dú)的帳戶“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具有管理權(quán)限,我仍然不能使用SFTP編輯服務(wù)器中的文件。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.
現(xiàn)在我有一些PHP腳本可以在服務(wù)器中保存圖像。他們沒有權(quán)限保存這些圖像。計(jì)劃不奏效。
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!
我認(rèn)為它們都是相關(guān)的,我搞砸了一些基本的東西。我希望能在正確的方向上得到任何和所有的幫助!
1 個(gè)解決方案
#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”的問題,因?yàn)檫@似乎是問題開始的時(shí)候。嘗試將所有者更改為“www-data”,看看這是否修復(fù)了PHP腳本權(quán)限問題。
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用戶添加到具有編輯文件權(quán)限的組中,使用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應(yīng)該是可行的(它似乎是基于ubuntu的標(biāo)準(zhǔn)組)
sudo usermod -a -G www-data Archer
sudo usermod -a -G www-data Archer
總結(jié)
以上是生活随笔為你收集整理的linux 使用nginx 权限不够,对于nginx和Linux,有一些关于权限的问题。的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 专家:中国汽车产业进入淘汰赛 将从百家变
- 下一篇: 国债逆回购手续费是多少 成交额的十万分