我正在运行一个脚本来在服务器上部署一个网站。它给出了以下错误:
DEBUG [4223cc8a] Command: /usr/bin/env chmod +x /tmp/mysite_staging/git-ssh.sh
DEBUG [4223cc8a] changing permissions of `/tmp/mysite_staging/git-ssh.sh'
DEBUG [4223cc8a] : Operation not permitted它抱怨部署用户无法更改该文件的权限。我已经设置了它,以便部署用户可以读、写、执行文件,因为用户在部署组中:
$ ls -l
total 4
-rwxrwx--x. 1 root deploy 93 Aug 5 09:22 git-ssh.sh那么,如何使部署用户能够更改该文件的权限?这是在CentOS上。我的临时解决方案是让部署用户成为文件的所有者。
发布于 2015-08-05 13:48:44
只有文件的所有者或根用户才能更改文件的权限。您需要更改文件的所有权,使其为deploy用户所有,或者以根用户的身份运行脚本。
发布于 2020-09-18 23:29:53
与chmod‘’ing上传的shell脚本不同,让Cap将它们放在一个非全局tmp位置将更加安全。例如:
set :tmp_dir, "/home/deploy/tmp"
https://unix.stackexchange.com/questions/220338
复制相似问题