先设置好带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呢?求教。
有帖子说,要设置成下面那样。但我压根就没有密码啊。
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呢?求教。