Cheug's Blog

当前位置:网站首页 / Server / 正文

CentOS7.X快速修改SSH端口

2020-08-06 / Server / 1629 次围观 / 0 次吐槽 /

1. 修改sshd配置文件,# vi /etc/ssh/sshd_config 

   取消“#Port 22”前面的#号,或另起一行新增Port 6022(自定义端口),wq保存退出

2. yum provides semanage

3. yum -y install policycoreutils-python

4. semanage port -a -t ssh_port_t -p tcp 6022

5. firewall-cmd --permanent --zone=public --add-port=6022/tcp

6. firewall-cmd --reload

7. systemctl restart sshd.service

Powered By Cheug's Blog

Copyright Cheug Rights Reserved.