Hi everyone,
I am currently writing a script that I want to be able to run shell commands as a specified and constantly changing user on the system, also I don't want to use root.
Basically when a user registers for an account the script creates an account for them on the local Linux system (matching the user they gave for the mySQL login), they are then given a /home/$username/ directory, obviously this is owned by the user "username" and the rest of the script will allow them to modify files and folders within this directory (much like the way cPanel works I suppose).
To allow my PHP script to edit the directory I could just allow my PHP root access to the system... Overriding the Linux security... but I would rather use some kind of suPHP to define run this command as this "$username therefore adding more secuirty so if a injection attack was possible through the user inputs they would still only be allowed access to their local system resources... not things like shadow files and other user files.
Hope that makes sence, look forward to any other ideas you may have as well.
Thanks, Tom