Dear Tanmaya, thanks for your reply, both here and “offtopic”. I am aware that I cannot change file ownership which is run every 24 hours, thanks anyway for the clarification. Please let me rephrase the question;
As I understand it I would need phpSuExec or suPhp running on the server to avoid having to set file permissions to 777 for change in Joomla modules and addons. Whenever I change permissions to 777 I have a security issue, so it is important to change them back. I am looking for a way to handle the security issue more effective by running a script which I can use in several Joomla webs;
Can I make a script like this:
<?php
// Read and write for owner, nothing for everybody else
chmod("/somedir/somefile", 0600);
// Read and write for owner, read for everybody else
chmod("/somedir/somefile", 0644);
// Everything for owner, read and execute for others
chmod("/somedir/somefile", 0755);
// Everything for owner, read and execute for owner's group
chmod("/somedir/somefile", 0750);
?>
make a text file with .php extention
insert the file in a directory of the web
open the file in a web browser to execute it? Hm… I guess the current user to run the script must be the file owner… can I run it by using a cron job?