While setting up a script to convert documents to PDF using libreoffice on AWS, I can't get libreoffice to --convert-to pdf
without sudo
as perhaps the user wsgi
does not have write permissions to the /opt/python/current/app
directory.
So I plan to solve this by appending the following line to the /etc/sudoers
file:
wsgi ALL = NOPASSWD: /opt/libreoffice5.3/program/soffice.bin
As I want to automate this while deploying, in my .ebextensions/01_packages.config
I have
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"
Is there a potential security issue with this?