权限 – 为什么我收到权限被拒绝错误?

前端之家收集整理的这篇文章主要介绍了权限 – 为什么我收到权限被拒绝错误?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试创建一个符号链接,但我得到了许可被拒绝.我怎么说出原因?
ln -nfs /home/deploy/foo/shared/config/Nginx.conf /etc/Nginx/sites-enabled/foo
ln: Failed to create symbolic link `/etc/Nginx/sites-enabled/foo': Permission denied

这是我的visudo文件内容

# This file is managed by Chef.
# Do NOT modify this file directly.

Defaults      !lecture,tty_tickets,!fqdn

# User privilege specification
root          ALL=(ALL) ALL

deploy ALL=(ALL) ALL

# Members of the group 'sysadmin' may gain root privileges
%sysadmin ALL=(ALL) ALL
# Members of the group 'sysadmins' may gain root privileges
%sysadmins ALL=(ALL) ALL

我以一个名为deploy的用户身份登录,我在sysadmins组内.

whoami
deploy

cat /etc/group
deploy:x:1000:
sysadmin:x:2300:deploy
我们在评论中讨论过:

你应该使用sudo运行你的ln命令:

sudo ln -nfs /home/deploy/foo/shared/config/Nginx.conf /etc/Nginx/sites-enabled/foo

现在,如果由于Capistrano 3(我不知道)而无法实现这一点,则必须为部署用户提供对文件夹/ etc / Nginx / sites-enabled的写权限.

猜你在找的Ubuntu相关文章