ผลต่างระหว่างรุ่นของ "2. ตั้งค่า firewall CentOS 8"
ไปยังการนำทาง
ไปยังการค้นหา
Created page with "4. ทำการตั้งค่าเปิด firewall *ตรวจสอบสถานะของ firewall โดยต้องได้สถานะ Active (runn..." |
ลไม่มีความย่อการแก้ไข |
||
| บรรทัดที่ 1: | บรรทัดที่ 1: | ||
1. ตรวจสอบสถานะ firewalld service บน mail server โดยต้องได้สถานะ active (running) | |||
'''# systemctl status firewalld''' | '''# systemctl status firewalld''' | ||
''ตัวอย่าง'' | |||
'''Active: <span style='color:red'>active (running)</span> since Mon 2019-11-18 14:12:03 +07; 1h 13min ago''' | |||
2. ตรวจสอบ firewall zone และ network interface ที่เปิดอยู่ | |||
'''# firewall-cmd --get-active-zones''' | '''# firewall-cmd --get-active-zones''' | ||
''ตัวอย่าง'' | |||
''' | |||
public | public | ||
interfaces: ens32 | interfaces: ens32 | ||
''' | |||
3. ตรวจสอบรายการ services ของ firewall ที่ zone public | |||
'''# firewall-cmd --zone=public --list-services''' | '''# firewall-cmd --zone=public --list-services''' | ||
cockpit dhcpv6-client ssh | ''ตัวอย่าง'' | ||
''' cockpit dhcpv6-client ssh ''' | |||
4. เปิด firewall services ที่ zone public ของ mail server (สามารถเปิดเท่าต้องการได้) | |||
'''# firewall-cmd --permanent --zone=public --add-service=http | '''# firewall-cmd --permanent --zone=public --add-service=http | ||
'''# firewall-cmd --permanent --zone=public --add-service=https | '''# firewall-cmd --permanent --zone=public --add-service=https | ||
| บรรทัดที่ 31: | บรรทัดที่ 38: | ||
2. ปิด selinux (เพื่อสะดวกต่อการ configure แต่ความปลอดภัยจะลดลง) | |||
*เปลี่ยน SELinux=enforcing เป็น SELinux=disabled | *เปลี่ยน SELinux=enforcing เป็น SELinux=disabled | ||
'''# vi /etc/selinux/config''' | '''# vi /etc/selinux/config''' | ||
| บรรทัดที่ 55: | บรรทัดที่ 62: | ||
3. ติดตั้ง wget เพื่อใช้ download service ที่จำเป็นต้องใช้งานเพิ่ม | |||
'''# yum install wget''' | '''# yum install wget''' | ||
รุ่นแก้ไขเมื่อ 16:09, 26 ตุลาคม 2563
1. ตรวจสอบสถานะ firewalld service บน mail server โดยต้องได้สถานะ active (running)
# systemctl status firewalld
ตัวอย่าง
Active: active (running) since Mon 2019-11-18 14:12:03 +07; 1h 13min ago
2. ตรวจสอบ firewall zone และ network interface ที่เปิดอยู่
# firewall-cmd --get-active-zones
ตัวอย่าง
public interfaces: ens32
3. ตรวจสอบรายการ services ของ firewall ที่ zone public
# firewall-cmd --zone=public --list-services
ตัวอย่าง
cockpit dhcpv6-client ssh
4. เปิด firewall services ที่ zone public ของ 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)
2. ปิด 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
3. ติดตั้ง wget เพื่อใช้ download service ที่จำเป็นต้องใช้งานเพิ่ม
# yum install wget