How to Change the Default SSH Port on CentOS

To change the CentOS default SSH port to 8223:

vi /etc/ssh/sshd_config


Make the following change:

#Port 22
to
Port  8223

Restart SSH:

service sshd restart

Add an exception to the firewall:

#/sbin/iptables -I INPUT -p tcp –dport 8223 -j ACCEPT
#/etc/rc.d/init.d/iptables save
#service iptables restart

Leave a Comment

Your email address will not be published.