[SOLVED] php script plaintext password

A

Anonymous

Guest
Hi all,

i was wondering how i can setup php with apache the right way. I have installed both, and i need to run some scripts including bash scripts.

example:
Code:
$amount=shell_exec("vmrun <options> <user> <password> > <file> | wc -l");
To do this i need to type a plaintext password for the user, but the file also must be readable for php, and therefore the file permissions are 644, this allows anyone to read the file including the password.

When i remove the read permissions, php cannot read the script.

Any suggestions ?
 
Solved this by creating a password file for user and group apache only.

vmrun -p `cat /<path>/<to>/<passwordfile>`
 
Back
Top