# ความปลอดภัย

![](/files/-MiAVigLfzV_qvvCNd7G)

ถ้า Run Bot ข้างนอก เช่น เปิด Server บน Cloud ขึ้นมา Run Bot iWallet โดยเฉพาะ อย่าลืมตั้งค่าความปลอดภัยให้กับ Server ดังนี้&#x20;

1. กำหนด Remote SSH (Secure Shell) ด้วย Key Pair (Private Key + Public Key) เท่านั้น ห้าม Remote ด้วย Username/Password
2. กำหนด Firewall อนุญาตให้เข้าถึง Server ได้เฉพาะ IP ที่กำหนดเท่านั้น
3. กำหนด Firewall อนุญาตให้เข้าถึง Server ได้เฉพาะ Port ที่กำหนดเท่านั้น เช่น Port 80, 443 หรือ 22 ส่วน Port อื่น ๆ ปิดให้หมด (Port 22 อาจจะเปลี่ยนไปใช้ Port อื่นก็ได้)
4. อย่าลืมทำ Https อาจจะใช้ Nginx + Let's Encrypt หรือใช้ Cloudflare ช่วยก็ได้
5. อย่ากำหนด Domain Name ให้เดา และเข้าถึงได้ง่าย&#x20;
   * อาจจะกำหนดเป็น Sub Domain Name ในการเข้าถึง Bot ด้วย UUID ก็ได้ เช่น `ae78b19c-0070-42b8-8763-6581551c69ed.mydomain.com`&#x20;
   * อย่าตั้งเป็นชื่อที่คนเดาได้ง่าย เช่น `iwallet.mydomain.com`&#x20;
   * ถ้ากลัวจำไม่ได้ ก็ให้ Bookmark ไว้&#x20;
6. ตั้งรหัสผ่านในการเข้าใช้งาน iWallet ให้ยากเข้าไว้&#x20;
7. อย่าลืมกำหนด Permission ให้กับไฟล์ต่าง ๆ เช่น กำหนดสิทธิ์เป็น&#x20;
   * chmod `600` สำหรับไฟล์ที่เจ้าของอ่าน และแก้ไขได้เท่านั้น หรือ
   * chmod `400` สำหรับไฟล์ที่เจ้าของอ่านได้เท่านั้น&#x20;
   * อย่ากำหนดเป็น chmod `777`  &#x20;
8. อย่าติดตั้ง Software ที่คิดว่าไม่น่าจะปลอดภัยเข้าไปรวมใน Server ที่ Run Bot
9. อย่าลืม Backup Wallet File และ Configuration File อื่น ๆ ก่อนใช้งานจริง&#x20;
10. อย่าเก็บ Token ที่มีมูลค่ามาก ๆ ไว้ใน iWallet Server เครื่องเดียว พยายามกระจายความเสี่ยงออกไปหลาย ๆ Server

อื่น ๆ ถ้าทำเพิ่มได้ก็จะดีมาก


---

# Agent Instructions: 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:

```
GET https://iwallet.jittagornp.me/security.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
