[root@localhost ~]# vim /etc/ssh/sshd_config #Port 22 Port 18022 #新增ssh端口 [root@localhost ~]# service sshd restart [root@localhost ~]# [root@localhost ~]# vi /etc/sysconfig/iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 18022 -j ACCEPT #新增防火墙端口 [root@localhost ~]# service iptables restart