我/etc/sudoers
需要为这个命令授予无密码 sudo:
/usr/bin/env sudo ln -nfs /home/deployer/apps/myapp_staging/shared/config/nginx.conf /etc/nginx/sites-enabled/
对于deployer
用户来说。
我尝试了以下操作但没有成功:
deployer ALL=(ALL) NOPASSWD: /etc/nginx/sites-enabled/
少了什么东西?
答案1
命令本身缺失。请尝试
deployer ALL=(ALL) NOPASSWD: /bin/ln -nfs /home/deployer/apps/myapp_staging/shared/config/nginx.conf /etc/nginx/sites-enabled/