ผลต่างระหว่างรุ่นของ "1. ตั้งค่า Host ให้พร้อมใช้งาน"
ไปยังการนำทาง
ไปยังการค้นหา
ไม่มีความย่อการแก้ไข |
ไม่มีความย่อการแก้ไข |
||
| บรรทัดที่ 19: | บรรทัดที่ 19: | ||
*ตรวจสอบสถานะของ firewall โดยต้องได้สถานะ Active (running) | *ตรวจสอบสถานะของ firewall โดยต้องได้สถานะ Active (running) | ||
'''# systemctl status firewalld''' | '''# systemctl status firewalld''' | ||
*ตรวจสอบ Zone และ Interface ของ Network ที่ใช้อยู่ปัจจุบัน | *ตรวจสอบ Zone และ Interface ของ Network ที่ใช้อยู่ปัจจุบัน | ||
'''# firewall-cmd --get-active-zones''' | '''# firewall-cmd --get-active-zones''' | ||
| บรรทัดที่ 24: | บรรทัดที่ 25: | ||
public | public | ||
interfaces: ens32 | interfaces: ens32 | ||
*ตรวจสอบ service ที่ firewall เปิดให้ใช้งาน | *ตรวจสอบ service ที่ firewall เปิดให้ใช้งาน | ||
'''# firewall-cmd --zone=public --list-services''' | '''# firewall-cmd --zone=public --list-services''' | ||
| บรรทัดที่ 41: | บรรทัดที่ 43: | ||
*ตรวจสอบ service ของ firewall ที่เปิดเพิ่ม | *ตรวจสอบ service ของ firewall ที่เปิดเพิ่ม | ||
'''# firewall-cmd --zone=public --list-services''' | '''# firewall-cmd --zone=public --list-services''' | ||
cockpit dhcpv6-client http https imap imaps mysql smtp smtps ssh | |||
''*add firewall service for mail server (https://spalinux.com/2015/06/centos-7-basic-configure-firewall-by-firewall-cmd)'' | |||
5. ปิด selinux (เพื่อสะดวกต่อการ configure แต่ความปลอดภัยจะลดลง) | |||
*เปลี่ยน SELinux=enforcing เป็น SELinux=disabled | |||
'''# vi /etc/selinux/config''' | |||
# This file controls the state of SELinux on the system. | |||
# SELINUX= can take one of these three values: | |||
# enforcing - SELinux security policy is enforced. | |||
# permissive - SELinux prints warnings instead of enforcing. | |||
# disabled - No SELinux policy is loaded. | |||
SELINUX='''''[[disabled]]''''' | |||
# SELINUXTYPE= can take one of these two values: | |||
# targeted - Targeted processes are protected, | |||
# mls - Multi Level Security protection. | |||
SELINUXTYPE=targeted | |||
*Restart ระบบ และทำการตรวจสอบ | |||
'''# reboot''' | |||
*ตรวจสอบสถานะของ SELinux | |||
'''# sestatus''' | |||
disabled | |||
รุ่นแก้ไขเมื่อ 08:56, 3 ธันวาคม 2562
1. สั่ง update service ทั้งหมดของ centos ทั้งหมด ให้เป็นปัจจุบัน
# yum update
2. ตั้งชื่อ host
# hostnamectl set-hostname mail.eai.in.th
3. เพิ่มชื่อ mail.eai.in.th
# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 mail.eai.in.th ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 mail.eai.in.th
*ระวัง envelopment ของทาง partner ว่าติดตั้ง centos ในรูปแบบใดมาให้ (อาจจะต้องติดตั้ง service เพิ่ม หากติดตั้งมาแบบ minimal เช่นใช้คำสั่ง vi ไม่ได้)
4. ทำการตั้งค่าเปิด firewall
- ตรวจสอบสถานะของ firewall โดยต้องได้สถานะ Active (running)
# systemctl status firewalld
- ตรวจสอบ Zone และ Interface ของ Network ที่ใช้อยู่ปัจจุบัน
# firewall-cmd --get-active-zones
public interfaces: ens32
- ตรวจสอบ service ที่ firewall เปิดให้ใช้งาน
# firewall-cmd --zone=public --list-services
cockpit dhcpv6-client ssh
- เพิ่ม service ของ mail server ที่เราจะต้องใช้
# firewall-cmd --permanent --zone=public --add-service=http # firewall-cmd --permanent --zone=public --add-service=https # firewall-cmd --permanent --zone=public --add-service=mysql # firewall-cmd --permanent --zone=public --add-service=smtp # firewall-cmd --permanent --zone=public --add-service=smtps # firewall-cmd --permanent --zone=public --add-service=imap # firewall-cmd --permanent --zone=public --add-service=imaps # firewall-cmd --reload
- ตรวจสอบ service ของ firewall ที่เปิดเพิ่ม
# firewall-cmd --zone=public --list-services
cockpit dhcpv6-client http https imap imaps mysql smtp smtps ssh
*add firewall service for mail server (https://spalinux.com/2015/06/centos-7-basic-configure-firewall-by-firewall-cmd)
5. ปิด selinux (เพื่อสะดวกต่อการ configure แต่ความปลอดภัยจะลดลง)
- เปลี่ยน SELinux=enforcing เป็น SELinux=disabled
# vi /etc/selinux/config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
- Restart ระบบ และทำการตรวจสอบ
# reboot
- ตรวจสอบสถานะของ SELinux
# sestatus
disabled