关于前端:Linux修改ssh端口

3次阅读

共计 363 个字符,预计需要花费 1 分钟才能阅读完成。

Linux 批改 ssh 端口

服务器环境:CentOS 7.9
工具:Xshell7

// 在 sshd_config 中增加端口
vi /etc/ssh/sshd_config

// 重启 ssh 服务
systemctl restart sshd

// 增加防火墙端口的前提是防火墙要关上
systemctl start firewalld

// 向防火墙增加一个可凋谢的例外
firewall-cmd –zone=public –add-port=” 增加的端口 ”/tcp –permanent

// 呈现 yes 示意防火墙放行胜利
firewall-cmd –permanent –query-port=” 增加的端口 ”/tcp

// 重启加载防火墙
firewall-cmd –reload

// 查看防火墙放行的端口
firewall-cmd –zone=public –list-ports

正文完
 0