在 AWS 上设置脚本以使用 libreoffice 将文档转换为 PDF 时,我无法获得 libreoffice,因为用户可能--convert-to pdf
没有对该目录的写入权限。sudo
wsgi
/opt/python/current/app
所以我计划通过将以下行附加到/etc/sudoers
文件来解决这个问题:
wsgi ALL = NOPASSWD: /opt/libreoffice5.3/program/soffice.bin
由于我想在部署时自动执行此操作,因此.ebextensions/01_packages.config
我有
container_commands:
01_edit_sudoers_only_once:
command: "echo 'wsgi ALL = NOPASSWD: /opt/libreoffice5.3/program/soffice.bin' >> /etc/sudoers"
test: "test ! -f .sudoers_edited"
02_mark_sudoers_as_edited:
command: "touch .sudoers_edited"
这是否存在潜在的安全问题?