หน้า 1 จากทั้งหมด 1

เปลี่ยน SSH Port บน Centos 7

โพสต์: อาทิตย์ 28 ส.ค. 2022 22:55
โดย slwt2002
1.แก้ไขไฟล์ sshd config

โค้ด: เลือกทั้งหมด

vi /etc/ssh/sshd_config
2.แก้ # ออก
Port 2233

3.ติดตั้ง policycoreutils-python

โค้ด: เลือกทั้งหมด

yum install policycoreutils-python -y
4.เพิ่ม Port

โค้ด: เลือกทั้งหมด

semanage port -a -t ssh_port_t -p tcp 2233
5.เปิด firewall port

โค้ด: เลือกทั้งหมด

firewall-cmd --permanent --zone=public --add-port=2233/tcp

โค้ด: เลือกทั้งหมด

firewall-cmd --reload
6.restart ssh

โค้ด: เลือกทั้งหมด

systemctl restart sshd.service