开发者社区 问答 正文

linux中配置防火墙以接受仅来自已知网段的 SSH 连接的方法是什么?

linux中配置防火墙以接受仅来自已知网段的 SSH 连接的方法是什么?

展开
收起
游客qzzytmszf3zhq 2021-12-05 18:02:11 592 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • Update /etc/sysconfig/iptables (Redhat specific file) to accept connection only 
    from 192.168.100.0/24 and 209.64.100.5/27, enter:
    
    -A RH-FW-1-INPUT -s 192.168.100.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT
    -A RH-FW-1-INPUT -s 209.64.100.5/27 -m state --state NEW -p tcp --dport 22 -j ACCEPT
    
    2021-12-05 19:00:45 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等