V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
通过以下 Referral 链接购买 DigitalOcean 主机,你将可以帮助 V2EX 持续发展
DigitalOcean - SSD Cloud Servers
qiongqi
V2EX  ›  VPS

自己把digitalocean上vps的iptables弄坏了。现在ssh上不去了。。

  •  
  •   qiongqi · 2013-12-10 01:37:22 +08:00 · 1639 次点击
    这是一个创建于 3791 天前的主题,其中的信息可能已经有所发展或是发生改变。
    求助?
    这种的怎么办?需要给官方发ticket吗?
    果然iptables还不是我能碰的东西
    23 条回复    1970-01-01 08:00:00 +08:00
    lanbing
        1
    lanbing  
       2013-12-10 01:49:16 +08:00 via Android   ❤️ 1
    vnc
    iZr
        2
    iZr  
       2013-12-10 01:50:24 +08:00   ❤️ 1
    哈哈。确实是。vnc联系吧。
    zhangxiao
        3
    zhangxiao  
       2013-12-10 01:50:33 +08:00   ❤️ 1
    The Droplet > Access > Console
    zhangxiao
        4
    zhangxiao  
       2013-12-10 01:52:34 +08:00   ❤️ 1
    qiongqi
        5
    qiongqi  
    OP
       2013-12-10 02:04:01 +08:00
    @lanbing
    @zhangxiao

    感谢,搞定了,
    本来是设置着玩,然后不行的话,就用api reboot下,
    结果刚才一脑残,执行了下 && /etc/rc.d/init.d/iptables save
    qiongqi
        6
    qiongqi  
    OP
       2013-12-10 02:05:07 +08:00
    @iZr 漏了个感谢,补上
    zhangxiao
        7
    zhangxiao  
       2013-12-10 02:12:57 +08:00   ❤️ 2
    @qiongqi 最好写一个脚本搞iptables,比如https://gist.github.com/zhangxiao/7877102
    qiongqi
        8
    qiongqi  
    OP
       2013-12-10 02:19:14 +08:00
    @zhangxiao 已fork
    raptor
        9
    raptor  
       2013-12-10 09:02:41 +08:00   ❤️ 2
    直接配iptables太麻烦了,我现在都用shorewall。
    shorewall有一个很好的功能:try,可以设置一个超时,如果配置不对,在这个时间到以后,它会恢复。
    TankyWoo
        10
    TankyWoo  
       2013-12-10 09:31:55 +08:00   ❤️ 1
    给个建议:

    1. 最好先本地测试好,再放到线上环境
    2. 刚在线上环境跑时,不确定是否ok,可以写个临时脚本,比如每5分钟清空一下规则,等确认完全可以正常使用,再去掉。
    iZr
        11
    iZr  
       2013-12-10 10:08:37 +08:00
    收藏。谢谢
    lisposter
        12
    lisposter  
       2013-12-10 11:29:28 +08:00
    想起刚玩vps的时候,弄sshkey,禁用密码,改端口,然后iptables忘记添加端口,禁用所有其他端口,然后傻逼的重装。。
    tywtyw2002
        13
    tywtyw2002  
       2013-12-10 11:43:34 +08:00
    我可以说我的iptables上来就是-F吗。。。。。。
    likuku
        14
    likuku  
       2013-12-10 11:53:05 +08:00
    @raptor 老外给我们文档就是shorewall,看起来很复杂,不过日常试用的策略都很简单,也就懒得搞这个了。
    chilaoqi
        15
    chilaoqi  
       2013-12-10 14:48:58 +08:00
    感觉iptables 绝对是个落伍的产品, 只是现在没有合适的替代
    cute
        16
    cute  
       2013-12-10 15:41:24 +08:00
    @chilaoqi
    nftables
    deyu260
        17
    deyu260  
       2013-12-10 16:17:14 +08:00
    crontab里跑个每10分钟 iptables -F
    DreaMQ
        18
    DreaMQ  
       2013-12-10 16:48:59 +08:00 via Android
    有vnc还怕什么
    wanderer
        19
    wanderer  
       2013-12-10 16:56:14 +08:00
    还好我没有开机自动运行 iptalbes-restore
    chilaoqi
        20
    chilaoqi  
       2013-12-10 17:01:46 +08:00
    @cute
    还真没用过. 有没有不小心屏蔽了22端口这么反人类的设计?
    还有,能根据D或S的ip删除rule么? iptables 删除个rules累死了
    chenwl
        21
    chenwl  
       2013-12-10 17:11:51 +08:00
    @lisposter 干过同样事
    xierch
        22
    xierch  
       2013-12-10 20:21:07 +08:00
    @chilaoqi 快换了
    http://www.solidot.org/story?sid=36893

    "nftables provides a new packet filtering framework, a new userspace utility and also a compatibility layer for {ip,ip6}tables."
    raptor
        23
    raptor  
       2013-12-11 08:51:53 +08:00
    @likuku iptables我很早以前用过,用了shorewall以后就再也不想去用iptables了。其实shorewall就是对iptables的包装,但是好用多了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2829 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:56 · PVG 10:56 · LAX 19:56 · JFK 22:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.