修改ssh默认端口
vim /etc/ssh/sshd_config
修改ssh默认22端口,然后保存退出
Port xxxx
重启sshd
service sshd restart || systemctl restart sshd.service
如果出现如下问题
Redirecting to /bin/systemctl restart sshd.service
执行以下命令
systemctl status sshd.service
systemctl start sshd.service
systemctl restart sshd.service
systemctl enable sshd.service
netstat -tlun
退出,然后用修改之后的端口重新连接SSH