Hi,
There is a way to lock the user in a directory in a similar way than open_basedir (php.ini) do
Actually I can read all the files from the server that have the "xx4" attribute, I did some experiments that works with mod_fcgid actually I am uisng this script to test or revert changes.
In this way I am changing the group from the [user] to [nobody] so apache have access and all the rest of the things ftp,ssh etc but the public access is completely blocked, but this works only in mod_fcgid, I tested with suPHP and doesn't work, another thing is that I am not sure how safe this will be from the group nobody or from apache.
chown [user]:nobody /home/[user]/www/ -R
find /home/[user]/www/ -type f -exec chmod 640 {} \;
find /home/[user]/www/ -type d -exec chmod 750 {} \;
The big problem of doing this is that all the new files uplaoded by ftp or created by php will have the default settings I guess I need to setup wrappers to do that because running a cron that detect file changes is not exactly a solution.
-Cheers
There is a way to lock the user in a directory in a similar way than open_basedir (php.ini) do
Actually I can read all the files from the server that have the "xx4" attribute, I did some experiments that works with mod_fcgid actually I am uisng this script to test or revert changes.
Code:
#!/bin/sh
#with $1 = user $2=user nobody fcgid!
if [ $1 == "--help" ]
then
echo This will set the default www permisions based in a cpanel user account
echo For a extended Security with FCGID add nobody as a second parameter
exit
fi
if [ "$2" == "nobody" ]
then
chown $1:nobody /home/$1/www/ -R
find /home/$1/www/ -type f -exec chmod 641 {} \;
find /home/$1/www/ -type d -exec chmod 750 {} \;
fi
if [ "$2" == "" ]
then
chown $1:$1 /home/$1/www/ -R
find /home/$1/www/ -type f -exec chmod 644 {} \;
find /home/$1/www/ -type d -exec chmod 755 {} \;
fi
chown $1:nobody /home/$1/www/
chown [user]:nobody /home/[user]/www/ -R
find /home/[user]/www/ -type f -exec chmod 640 {} \;
find /home/[user]/www/ -type d -exec chmod 750 {} \;
The big problem of doing this is that all the new files uplaoded by ftp or created by php will have the default settings I guess I need to setup wrappers to do that because running a cron that detect file changes is not exactly a solution.
-Cheers
Last edited: