1、vi /etc/ssh/ssh_config

#添加两个远程端口,是为了防止修改出错导致 22 也登不上就麻烦了

Port 22

Port 8094

保存


2、vi /etc/ssh/sshd_config 

Port 22

Port 8094

保存


3、iptables -I INPUT -p tcp --dport 8094 -j ACCEPT

防火墙上开端口 


service iptables save


service sshd restart

service iptables restart