Home WebServer PanelcPanel Protect the folder on cPanel

Protect the folder on cPanel

by Thạch Phạm
Published: Last Updated on

In this tutorial, AZDIGI will show you how to protect folders on cPanel by requiring access authentication.

I. Introduction

If your website has resources (documents, applications…) that users can download, you need to create a folder to store resources so they can access and download them. However, when accessing, visitors must have login information to be able to enter.

Or, if you want someone to access the http://domain.com/wp-admin path, they must go through the verification step before login account. It can be said to authenticate two different accounts.

This will make your folders more secure and can only be accessed by authorized people.

II. Enable folder protection on cPanel

To enable folder protection on cPanel, we need to do the following 2 steps.

Step 1: Login to cPanel

To login to cPanel you just need to access the following link:

AZDIGI Tutorial

You need to change IP address to the IP your server is using, or more simply, if the domain is active on this cPanel hosting, you can change the IP to your domain as follows: http://domain.com:2083

Below is my cPanel interface:

Screen Shot 2020 12 16 at 10.35.54 PM 2
User-level cPanel interface

We continue to step 2 to enable folder protection on cPanel.

Step 2: Enable folder protection on cPanel

First, we access the FILES feature => select File Manager to access the file management section.

image 90
File Manager on cPanel.

Next, visit the website’s source code directory. For example, I have created a directory calledtaixuong.

and in this directory, I have prepared some files.

image 92

Go back to the website folder, right-click on this folder and select Password Protect.


Below is the interface to enable folder protection oncPanel.


To enable folder protection on cPanel, select “Password protect this directory.” at 1. then (2) will automatically create default information if you want to be able to edit and finally select SAVE.

A message that successfully sets permissions for this folder will appear, with content similar to the following:

AZDIGI Tutorial
Success: The system set the access permissions for the “/home/username/domain.com/taixuong” directory.

Then, select “Go Back” and continue to configure the credentials as shown below:


You enter your username in (1), password in (2) & (3), if you want cPanel to generate a password for you automatically, click Password Generator in (4). Then, click SAVE in (5).

Please save this password. As shown below, I have set the username “bao“.

image 100

Please try accessing that folder again. The screen will display the request to enter username and password:


After entering the login information, you can access the folder and see the files.

image 103

So you have successfully enabled folder protection on cPanel.

III. Disable folder protection on cPanel

To disable the folder protection feature on cPanel, you can right-click the folder, do the same as step 2 and select Password Protect.

You need to untick “Password protect this directory.“. Then select SAVE, you will receive a message similar to the following:

AZDIGI Tutorial
Success: The system removed the access permissions for the “/home/username/domain.com/taixuong” directory.

IV. Summary

With just 2 simple steps, you can successfully protect the folder on cPanel. You completely protect the wp-admin directory for your WordPress website to create an extra layer of security for the website’s login.

Hope this article will be of help to you. Wishing you success!

See more useful cPanel articles at the following link:

If you need assistance, you can contact support in the ways below:

  • Hotline 247: 028 888 24768 (Ext 0)
  • Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com .
  • Register for cheap Hosting/VPS service here!
Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign