我已经建立了一个面向公众的Debian服务器在一个著名的网络托管提供商,并试图确定黑客是否入侵。我对网络服务器的安全知之甚少,但我正在努力学习。我已经将我的服务器配置为不允许在SSH上进行根登录,我还通过SSH禁用了密码登录。所有用户必须使用SSH密钥身份验证。我还安装了Fail2ban。我有一个帐户,但没有任何其他用户,所以没有其他人应该登录,但我。
当我运行命令"sudo like -f /var/log/btmp“来查看错误的登录尝试时,我会看到如下条目:
ubnt ssh:notty <ipaddress1> <date1> 16:55 - 17:22 (00:27)
admin ssh:notty <ipaddress2> <date2> 11:56 - 16:55 (04:58)
user ssh:notty <ipaddress3> <date3> 07:47 - 08:24 (00:36)
pi ssh:nottyp <ipaddress4> <date4> 10:46 - 11:11 (00:24)这些条目真的表明,尽管我采取了预防措施,黑客还是能够登录吗?
我还不明白的是,如果我运行命令"sudo -f /var/log/btmp",我将看到与上面相同的条目,只不过"time in“和"time”条目都是相同的。换句话说,不是这样的:
# sudo last -f btmp
ubnt ssh:notty <ipaddress1> <date1> 16:55 - 17:22 (00:27)我看到这个:
# sudo lastb -f btmp
ubnt ssh:notty <ipaddress1> <date1> 16:55 - 16:55 (00:00)在阅读了lastb的手册页之后,问题可能是我不应该对btmp运行最后一个,而应该针对它运行lastb。也许仅仅因为您可以为每个命令指定一个"-f“参数,这并不意味着命令是可交换的。
我还应该补充一点,我的/etc/passwd文件中没有任何帐户,上面显示了用户名。如果人们还在我不知情的情况下登录,我还能做什么来阻止这种情况呢?
谢谢。
发布于 2016-08-15 16:23:35
btmp登录尝试失败。这些用户帐户不一定存在才能出现在该日志中。如果您开始在wtmp或utmp中看到奇怪的条目,那么您应该开始担心了。
发布于 2016-08-15 16:29:20
事实上,BTMP登录尝试失败。为了让您更好地理解,下面是对从这里登录的人进行暴力攻击的一个例子:
berrie ssh:notty 121.130.202.148 Thu Jul 2 06:02 - 06:02 (00:00)
berrie ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:02 (00:00)
berri ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
berri ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
berni ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
berni ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
brenice ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
brenice ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
berni ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
berni ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernhard ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernhard ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernardo ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernardo ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernardi ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernardi ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernard ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernard ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernadin ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernadin ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernadin ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernadin ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernadet ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernadet ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernaden ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
bernaden ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
berna ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
berna ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)
berget ssh:notty 121.130.202.148 Thu Jul 2 06:01 - 06:01 (00:00)您可以看到同样的,过度的IP试图登录,也看到了不同的文本,他们正在使用登录。就这么简单,从你的外表看,没什么好担心的。
要防止这一点,您可以做的是确保您的密码尽可能复杂。按照本指南这里创建这样的密码。注意任何未来的尝试,如果有的话,并拒绝他们对服务器的任何访问-标记他们的IP并配置您的防火墙以防止传入连接。
编辑:
在回复你对我帖子的评论时,你担心有人会登录并留在你的邮箱里,这在你的情况下是没有发生的。他们没有用相同的详细信息多次登录,也没有两次使用相同的登录。所以你很好。
https://security.stackexchange.com/questions/133932
复制相似问题