I'm looking for way to modify configuration file that resides below /etc
directory via web (in particular case PHP) interface. While it's not a problem to read (if you set up file permissions correctly) it is when it comes to modifying/writing to files that cannot be written by non-owner and non-root user (www-data user
).
To be specific I'm after dovecot passwd file (/etc/dovecot/passwd
) and I want to write to in so I could change password for dovecot virtual user. I have PHP logic that can read, rearrange and prepare string for saving to /etc/dovecot/passwd
, except that it cannot go any further since, as I mentioned www-data
user cannot write to anything below /etc
directory.
Is there workaround for this?
Is there maybe some kind of proxy-binary or script that can be triggered via PHP with input parameters to do the job?
Thanks in advance.