In this post, we will explain to you how you could secure public_html. When it comes to hosting your website, permissions are crucial. Permissions will give our server computer access to your files, allowing it to write and edit them. In addition, as a protection precaution, certain files must be shielded from writing and editing.
1. At cPanel user level:
Step::1 Now Login to cPanel and select File Manager
Step::2 Change Permissions from the menu by right-clicking on public html.
Step::3 Set the permissions to 0750.
2. At Root level:
Step::1 Log on your WHM root and open Server Configuration
Step::2 Open Tweak Settings
Step::3 Next select Security tab and search the option “Enable File Protect”
Step::4 Now select On button and then the Save.
3. Via Filezilla SFTP;’
Step::1 Log on to Filezilla as root
Step::2 Next select /root and look for “fixperms.sh” file
Step::3 Open Below link- https://pastebin.com/K8Xd4DWy
Step::4 Copy and paste the entire code. fixperms.sh file
Step::5 Next then you need to add a Cron Job to This location- /var/spool/cron and edit the file “root”
Add a cronjob to run fixperms.sh every hour here. Save the following line:
This cron will run fixperms.sh many times to keep the file permissions of all cpanel’s public html files at 0750. You can protect public html this way.
In this method you can setup file permissions of any file in cPanel
Thanks for Reading this post !!!
If you’re looking for cheap web hosting. Please Contact to MEGA ACS HOST. Shared web hosting started at ₹ 399/Year.
Mega ACS Host: Website:- https://www.megaacshost.com/
Follow Us social media
Facebook Page– https://www.facebook.com/megaacshost/
Twitter Page– https://www.twitter.com/megaacshost