
1.登录服务器,打开sshd_config文件
vim etc/ssh/sshd_config
2.找到#Port 22,默认是注释掉的,先把前面的#号去掉,再插入一行设置成你想要的端口号,注意不要跟现有端口号重复
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
Port 22
Port 10086
3.保存后退出,执行重启命令
service sshd restart
4.开放端口
firewall-cmd --zone=public --add-port=10086/tcp --permanent
service firewalld restart(重启防火墙)
文章转载自百科远航,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




