前提假定:
已经修改了ssh.config和sshd.config,把端口都设置好了
开始:GO
firewall-cmd --add-port=8080/tcp
firewall-cmd --add-port=2380/tcp
echo "open port 8080, 2380"
echo "使用以下命令查看当前SElinux 允许的ssh端口:"
semanage port -l | grep ssh
echo "添加2380端口到 SELinux"
semanage port -a -t ssh_port_t -p tcp 2380
echo "然后确认一下是否添加进去"
echo "step3 重启ssh"
systemctl restart sshd.service
firewall-cmd --add-port=2380/tcp
echo "open port 8080, 2380"
echo "使用以下命令查看当前SElinux 允许的ssh端口:"
semanage port -l | grep ssh
echo "添加2380端口到 SELinux"
semanage port -a -t ssh_port_t -p tcp 2380
echo "然后确认一下是否添加进去"
echo "如果成功会输出 ssh_port_t tcp 2380, 22"
semanage port -l | grep ssh
echo "step3 重启ssh"
systemctl restart sshd.service