修改Linux 默认ssh端口22

1、打开 vi /etc/ssh/sshd_config
找到
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22 (此为ssh默认22号端口)
Port 55555
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

2、在Linux防火墙中放行 55555端口及重新启动ssh服务
firewall-cmd –zone=public –add-port=55555/tcp –permanent
systemctl restart sshd
firewall-cmd –reload

3、查看开放的的端口
netstat -lnpt