Change the remote port in CentOS 7 to 22023. Print

  • 546

sudo firewall-cmd --permanent --zone=public --add-port=22023/tcp

sudo firewall-cmd --reload

sed -i -e 's/#Port 22/Port 22023/g' /etc/ssh/sshd_config

sed -i -e 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config

sed -i -e "s/^SELINUX=.*/SELINUX=disabled/" /etc/selinux/config

 


Was this answer helpful?

« Back