我想修改使用 tut 创建的 nginx 服务器块。我尝试 cd in 但被拒绝。检查“stat”我发现该目录有 644 个权限。因此我执行了:
deploy@server:~$ sudo chmod 646 /etc/uwsgi/sites/
[sudo] password for deploy:
deploy@server:~$ stat /etc/uwsgi/sites/
File: '/etc/uwsgi/sites/'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 9041h/36929d Inode: 97128482 Links: 2
Access: (0646/drw-r--rw-) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-01-25 12:33:48.149427949 -0500
Modify: 2017-01-19 16:15:32.658184778 -0500
Change: 2017-01-25 12:33:45.812411548 -0500
Birth: -
但是当我尝试 cd in 时遇到了同样的问题:
deploy@server:~$ cd /etc/uwsgi/sites/
-bash: cd: /etc/uwsgi/sites/: Permission denied
我究竟做错了什么?
编辑:
deploy@server:~$ sudo chown deploy /etc/uwsgi/sites/
[sudo] password for deploy:
deploy@server:~$ cd /etc/uwsi/sites/
-bash: cd: /etc/uwsgi /sites/: Permission denied
deploy@server:~$
答案1
644 应该没问题,但您可以尝试使用 chown 更改文件夹的所有者。
chown deploy /etc/uwsgi/sites/
这对你有帮助吗?