Short answer
- Turn on two-factor authentication for the cPanel account and use long, different passwords for cPanel, each FTP account, each database and each mailbox.
- Replace FTP with SFTP or the panel's File Manager, so that passwords do not travel in clear text.
- Keep permissions at 755 on directories and 644 on files, disable dangerous PHP functions and expose_php in php.ini, and leave ModSecurity enabled.
- Delete the sites, subdomains and FTP accounts you no longer use, and add a periodically downloaded local copy to the provider's daily backup.
- First step
- 2FA on the cPanel account, a unique password
- File transfer
- SFTP on port 22 or the File Manager, never plain FTP
- Permissions
- directories 755, files 644, never 777
- php.ini
- expose_php = Off, disable_functions with exec, system, shell_exec
What you control on shared hosting and what your provider controls
Your provider normally looks after the operating system, server updates, isolation between accounts, the firewall and ModSecurity. You are responsible for everything inside your account: passwords, files, applications, databases and email. An outdated WordPress, an old FTP password or a test script forgotten on a subdomain are your problems, and the consequence is that the whole account falls, not only the affected site: a PHP file uploaded into an old site can read the files of every site in the same account, including the main site's wp-config.php.
Measures in order of impact
Start with access: 2FA on cPanel, a unique password from a password manager, and a review of FTP accounts and database users, deleting what you do not recognise. Move to SFTP, because FTP sends the password in clear text and on a public network it is the first password stolen. Then files: 755 and 644 permissions, never 777. In php.ini disable exec, system, shell_exec, passthru and proc_open, set expose_php to Off and run a supported PHP version. Give each mailbox its own password, because one cracked mailbox sends spam and puts your domain on blocklists.
- A separate FTP account, limited to one directory, for each collaborator and deleted when the job ends
- Test subdomains and old sites are deleted, not left 'just in case'
- Malware scanning if the provider offers it, and a copy of the backup downloaded to your own machine every month
What Romanian law expects
Shared hosting does not exempt you from GDPR: forms, customer accounts and the shop process personal data under your responsibility, and Article 32 requires adequate measures. The provider is your processor under the data processing agreement, but a weak FTP password and an outdated WordPress are your measures. After a breach, notifying ANSPDCP within 72 hours is your company's duty, not the provider's. Invoices issued through e-Factura must be retained, so a backup of the account, database included, also has a tax basis.
Security settings in cPanel and where to find them| Setting | Where in cPanel | Recommended value | What it prevents |
|---|
| Two-factor authentication | Security → Two-Factor Authentication | On, TOTP code | Account takeover with a stolen password |
|---|
| FTP accounts | Files → FTP Accounts | Only those needed, limited to one directory; use SFTP | Clear-text passwords, access to the whole account |
|---|
| File permissions | File Manager | 755 for directories, 644 for files | Writes by injected scripts |
|---|
| PHP settings | Software → MultiPHP INI Editor | Supported version, expose_php Off, disable_functions | Command execution from injected scripts |
|---|
| ModSecurity | Security → ModSecurity | Active on all domains | SQL injection, XSS, malicious uploads |
|---|
| Backup | Files → Backup | Provider's daily backup plus a monthly local download | Data loss, ransomware |
|---|
| Remote MySQL access | Databases → Remote MySQL | Empty, or exact IP addresses only | Brute force against the database |
|---|
Commands and configuration
php.ini (or MultiPHP INI Editor): no shell functions, no exposed versionexpose_php = Off
display_errors = Off
log_errors = On
allow_url_include = Off
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec
Correct permissions from Terminal (if enabled) or over SFTPfind ~/public_html -type d -exec chmod 755 {} \;
find ~/public_html -type f -exec chmod 644 {} \;
chmod 600 ~/public_html/wp-config.php
Practical examples
Tourism agency in Iasi with three sites in one account
An old campaign site on a subdomain, forgotten for two years, was broken through an outdated plugin. The intruder then read the main site's wp-config.php from the same account and injected redirects to gambling pages. Deleting the subdomain and changing every password came before restoring from backup.
Accounting practice in Cluj-Napoca with email on cPanel
A mailbox whose password matched the cPanel password was compromised and sent thousands of phishing messages overnight. The domain landed on blocklists and customers stopped receiving invoices. Unique passwords per mailbox, 2FA and the sending limit in the panel fixed it.
Common mistakes
- Using the same password for cPanel, FTP, the database and the main mailbox.
- Connecting over plain FTP, in clear text, from public networks.
- Setting 777 on directories to make an upload work, and leaving it that way.
- Keeping old, unpatched sites and subdomains in the same account as the main site.
- Relying only on the provider's backup and having no copy of your own.
How 4hosting helps
- cPanel plans include a Let's Encrypt certificate, a daily backup and email, which covers encryption in transit and basic recovery; the account hardening in this guide is still yours to apply.
- From cPanel Advanced up you get 1 h a month of included services. Request it from the DevOps Services section of the client panel, for example for a review of FTP accounts and PHP settings. The hour is not carried over to the next month, and extra hours are accepted and billed separately.
- WAF & DDoS Protection adds OWASP rules and bot filtering in front of your sites, on top of the L3/L4 DDoS protection included at network level.
Related questions
On shared hosting, can other accounts on the same server read my files?
Not if the provider isolates accounts properly, which is standard on modern cPanel. The real risk is inside your own account: all your sites share one user, so one compromised site exposes all of them. That is why old sites get deleted and important ones live in separate accounts.
Do I need a security plugin if the hosting has ModSecurity?
ModSecurity filters requests at server level, before PHP, and covers general attack patterns. It does not replace application updates, 2FA on the application's own admin panel or login attempt limits, which sit at application level. One plugin for those, plus ModSecurity, is enough.
How often should I download a local backup?
Monthly for a brochure site, weekly for a shop, and always before a major change. The local copy protects you in the scenario where the account is deleted, suspended or encrypted together with the backups kept on the server.