安全性考量上
會將網頁服務的目錄群組都設定在 www-data 這個群組裡~
再讓 www-data 群組裡的使用者都可以讀寫網頁目錄下的內容
e.g preivew
新增 group
一般來說, 網頁服務都會歸類到 www-data 群組裡
sudo addgroup www-data
將已存在的帳號加入已存在的群組
將 cola 帳號加入 www-data 群組
sudo usermod -a -G www-data cola
修改資料夾群組
將 test_web_folder 資料天加至 www-data 群組裡
sudo chown -R :www-data test_web_folder/
幫資料夾加上讀寫權限
讓擁有 test_web_folder/ 資料夾的群組都有修改權限
sudo chmod -R g+w test_web_folder/
列出 group 成員
列出目前 www-data 群組下的成員
grep www-data /etc/group
列出帳號加入了哪些 group
列出 cola 這個帳號所加入的 group
groups cola
ref.