> For the complete documentation index, see [llms.txt](https://docs.chiasebanquyen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chiasebanquyen.com/meo-bao-mat-cho-cpanel.md).

# MẸO bảo mật cho cPanel

### Đăng nhập vào cPanel và WHM safely <a href="#letsencrypt" id="letsencrypt"></a>

Đảm bảo đăng nhập vào cPanel và WHM bằng tên miền hoặc tên máy chủ được cài đặt SSL hợp lệ. không bao giờ đăng nhập bằng địa chỉ IP. ví dụ: nếu tên miền của bạn là example.com, hãy luôn đăng nhập vào cPanel bằng:

<https://example.com:2083>

và cho WHM:

<https://example.com:2087>

Để đăng nhập mà không cần SSL (Không được khuyến nghị), bạn có thể sử dụng:

cPanel :

<http://example.com:2082>

WHM :

<http://example.com:2086>

| Port number | SSL   | non-SSL |
| ----------- | ----- | ------- |
| 2083        | ĐÚNG  | KHÔNG   |
| 2082        | KHÔNG | ĐÚNG    |
| 2087        | ĐÚNG  | KHÔNG   |
| 2086        | KHÔNG | ĐÚNG    |

Một cách khác để đăng nhập vào cPanel là sử dụng công cụ đăng nhập cPanel tự động.

Để truy cập cPanel bằng tên miền của bạn (như example.com):

<https://example.com/cpanel>

cho WHM:

<https://example.com/whm>

### Firewall <a href="#hostname" id="hostname"></a>

Bạn có thể cài đặt CSF Firewall để bảo vệ mạng của mình, Các lệnh cài đặt:

```
cd /root
rm -fv csf.tgz
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
```

Để kiểm tra các mô-đun yêu cầu của CSF:

```
perl /usr/local/csf/bin/csftest.pl
```

Đừng lo lắng nếu bạn không thể chạy tất cả các tính năng, miễn là tập lệnh không báo cáo bất kỳ lỗi nghiêm trọng nào

Hướng dẫn cài đặt đầy đủ: <https://www.configserver.com/cp/csf.html>

### Secure SSH <a href="#ssh" id="ssh"></a>

Cố gắng không sử dụng cổng 22 để đăng nhập SSH. thay đổi nó từ tệp /etc/ssh/sshd\_config sang một số khác chẳng hạn: 1527 và lưu nó. Mở port đó trong Firewall  và chạy lệnh:

```
service sshd restart
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.chiasebanquyen.com/meo-bao-mat-cho-cpanel.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
