Article 5BMDN How can I get apache2 to write password to etc/passwd in a script

How can I get apache2 to write password to etc/passwd in a script

by
rblampain
from LinuxQuestions.org on (#5BMDN)
I am not familiar on the subject.
There are plenty of solution examples on the net but all involve user input somehow. I am sure this is a basic problem faced by many, many times before.

I have script writing files under Apache2 with user www-data, which need later to be read by other www-data owned scripts, but one part of the script needs to write a hashed password to etc/passwd (useradd) which needs root permission. Changing the script permission halfway through its execution and then restoring it seems complicated, an overkill and risky, is there an easy way?

What is a conventional solution to this problem?

Thank you for your help.latest?d=yIl2AUoC8zA latest?i=DOS9zlm47tI:rpSyIHjnjSI:F7zBnMy latest?i=DOS9zlm47tI:rpSyIHjnjSI:V_sGLiP latest?d=qj6IDK7rITs latest?i=DOS9zlm47tI:rpSyIHjnjSI:gIN9vFwDOS9zlm47tI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments