我正在尝试部署一个 rails 应用程序,我以前也做过,但这次我遇到了一个奇怪的问题。
为什么我无法运行此 chmod 命令?我目前以用户身份登录:csmsched
-bash-3.2$ pwd
/var/www/vhosts/mysite.com/staging
-bash-3.2$ ls -al
total 40
drwxrwxrwx 6 csmsched psaserv 4096 Mar 18 16:05 .
drwxr-xr-x 14 root root 4096 Mar 18 15:37 ..
drwxrwxrwx 2 csmsched psacln 4096 Mar 18 10:52 css
-rwxrwxrwx 1 csmsched psacln 1150 Mar 18 10:52 favicon.ico
drwxrwxrwx 6 csmsched psacln 4096 Mar 18 10:52 img
-rwxrwxrwx 1 csmsched psacln 8997 Mar 18 10:52 index.html
drwxrwxrwx 2 csmsched psacln 4096 Mar 18 10:52 mt_images
drwxrwxrwx 11 csmsched psacln 4096 Mar 18 10:52 test
-bash-3.2$ chmod g+w /var/www/mysite.com/staging/
chmod: changing permissions of `/var/www/mysite.com/staging/': Operation not permitted
-bash-3.2$
答案1
您输入了错误的目录名称。
而不是/var/www/vhosts/mysite.com/staging
您的chmod
命令包含/var/www/mysite.com/staging
。