The goal is to let the www-data
user execute sudo -u postgres -H osm2pgsql [some options here]
without being asked for a password (as this will be part of a script wich runs automatically).
I thought I could do it with the following line in sudoers
file
www-data ALL=NOPASSWD: /usr/bin/sudo -u postgres -H osm2pgsql *
But this does not seem to work. What am I doing wrong?
The syntax you need is
Defaults:www-data !requiretty
www-data ALL=(postgres) NOPASSWD: /usr/bin/osm2pgsql
where /usr/bin/osm2pgsql
should be replaced by the actual path of osm2pgsql
. The !requiretty
line allows the sudo from a script without a terminal. This allows the command sudo -u postgres -H osm2pgsql
with any options to work.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments