ubuntu - 使用 sudo chown -R $USER :$USER/dir/ectory/授予用户权限

标签 ubuntu permissions chown

我正在学习本教程:How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS .

我收到错误消息:第二步 - 授予权限,其中指出以下内容:

Now we have the directory structure for our files, but they are owned by our root user. If we want our regular user to be able to modify files in our web directories, we can change the ownership by doing this:

sudo chown -R $USER:$USER /var/www/example.com/public_html
sudo chown -R $USER:$USER /var/www/test.com/public_html

The $USER variable will take the value of the user you are currently logged in as when you press "ENTER". By doing this, our regular user now owns the public_html subdirectories where we will be storing our content.

We should also modify our permissions a little bit to ensure that read access is permitted to the general web directory and all of the files and folders it contains so that pages can be served correctly:

sudo chmod -R 755 /var/www

Your web server should now have the permissions it needs to serve content, and your user should be able to create content within the necessary folders.

我在命令行中输入了一行:sudo chown -R $USER:$USER/dir/ectory/ 然后我收到一条错误消息:chown: invalid group: ‘developer:developer’

我已经搜索过,但没有找到解决此问题的可行方法。 我正在使用 Ubuntu 14.04。我是 Ubuntu 和 Stackoverflow 的新手,所以对于我在提问时可能不会犯的任何愚蠢错误,我深表歉意。非常感谢任何帮助!

最佳答案

这有效:

sudo chown -R username:usergroup /var/www/nameofdirectory

关于ubuntu - 使用 sudo chown -R $USER :$USER/dir/ectory/授予用户权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25654315/

相关文章:

linux - 使用 awk 从文件中检索一组特定的字符串

azure - 如何设置 Azure CNAME

python - Django 身份验证和权限 : Snippets visible only to the creator

python - 什么用户应该拥有我的 Python 脚本和应用程序目录?

linux - 尽管用户存在但无法 chown

linux - 在 Ubuntu 上运行 SOAPUI 时 JVM 崩溃

ubuntu - 无法启动 Oracle 服务

php - 禁止访问!在 LAMPP 中

Android list 的 android :exported ="false" prevents app from running on device

Apache - 路径的某个组件缺少权限