求教 DO 设置 SSH Key 后爆破问题 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
通过以下 Referral 链接购买 DigitalOcean 主机,你将可以帮助 V2EX 持续发展
DigitalOcean - SSD Cloud Servers
Kuso
V2EX    VPS

求教 DO 设置 SSH Key 后爆破问题

  •  
  •   Kuso 2015 年 5 月 19 日
    这是一个创建于 3982 天前的主题,其中的信息可能已经有所发展或是发生改变。
    先设置好带passphrase的SSH Key,然后才开的Droplet,所以从一开始就是用key登录,DO也没有给我发root密码邮件。后来我又设置了PermitRootLogin without-password。自以为安全了,但日志里还是有大量爆破,看得眼花。

    有帖子说,要设置成下面那样。但我压根就没有密码啊。
    ChallengeResponseAuthentication no
    PasswordAuthentication no
    UsePAM no

    其实最大的问题是UsePAM的设置:
    # Set this to 'yes' to enable PAM authentication, account processing,
    # and session processing. If this is enabled, PAM authentication will
    # be allowed through the ChallengeResponseAuthentication and
    # PasswordAuthentication. Depending on your PAM configuration,
    # PAM authentication via ChallengeResponseAuthentication may bypass
    # the setting of "PermitRootLogin without-password".
    # If you just want the PAM account and session checks to run without
    # PAM authentication, then enable this but set PasswordAuthentication
    # and ChallengeResponseAuthentication to 'no'.
    我心想那就UsePAM no吧,但又看到有人说「设置问UsePAM no后无法通过key登陆。原来新建账户的时候没有给该账户设置密码,导致无法通过登陆。给账户设置一个密码后就可以通过key登陆了(因为是通过key登陆,所以建立账户没设置密码,但是UsePAM设置成no后,如果账户密码是空是无法通过key登陆的。)」。

    我就属于没密码的,怕设置完进不去,又要通过DO的网页控制台再去设置密码?而且我好奇的是,压根没密码,怎么爆破都没意义吧。到底用不用设置UsePAM no呢?求教。
    6 条回复    2015-05-19 13:07:25 +08:00
    clino
        1
    clino  
       2015 年 5 月 19 日
    换端口应该不会这么多攻击了吧
    Kuso
        2
    Kuso  
    OP
       2015 年 5 月 19 日
    @clino 在公司也要用,所以不能换陌生端口。其实他们实际爆破也无所谓,日志太长不看就是了。我是想知道,我目前的设置足够安全了么?用不用设置成ChallengeResponseAuthentication no PasswordAuthentication no UsePAM no ?
    clino
        3
    clino  
       2015 年 5 月 19 日 via Android
    用denyhosts或者类似的工具?
    clino
        4
    clino  
       2015 年 5 月 19 日 via Android
    @Kuso 公司其他人用也没关系,加上 ssh config 相关配置用起来其实不麻烦
    jianshu
        5
    jianshu  
       2015 年 5 月 19 日
    PasswordAuthentication no
    PermitEmptyPasswords no
    PermitRootLogin no
    UsePAM no

    UsePAM和PasswordAuthentication肯定要禁,然后随他扫吧。
    jianshu
        6
    jianshu  
       2015 年 5 月 19 日
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1061 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 22:52 PVG 06:52 LAX 15:52 JFK 18:52
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86