CHANGING DEFAULT PORT IN SSH AND PORT FORWARDING
Step1: edit /etc/ssh/sshd_config file
Step2: Allow custom port in selinux
semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
Step3: Allow custom port in firewall
firewall-cmd –add-port=2222/tcp –permanent
firewall-cmd –reload
Step4: restart or reload sshd services
systemctl reload sshd
PORT FORWARDING USING FIREWALLD
firewall-cmd –add-forward-port=port=22:proto=tcp:toport=2222 –permanent
firewall-cmd –reload
Leave a Reply