Post Views: 624
This is a simple script to solve the ownership issue under cpanel based server. Create an executable file on your server and run.
# echo -e “Checking ownership of /home/user n”
for i in `ls /var/cpanel/users/`
do
if [ “$i” != “root” ]; then
chown -R $i:$i /home/$i
chown $i:nobody /home/$i/public_html /home/$i/.htpasswds
chown $i:mail /home/$i/etc /home/$i/etc/*/shadow /home/$i/etc/*/passwd
echo $i
fi
done
Post navigation
Arunlal A
Engineer. Linux enthusiast. Traveller. DevOps learner and practitioner.
I enjoy working with Linux, DevOps, automation, and technology while exploring new places along the way. I use this space to share my experiences, learnings, experiments, and things I discover along the journey.
Whether you're a seasoned DevOps professional or just getting started, let's connect, learn, and grow together.
Happy coding, automating, and deploying!