当我在我的Centos 7机器上运行ps aux
命令时,我看到大约100个条目:
root 19862 0.0 0.0 151692 8 ? Ss Oct09 0:00 sshd: unknown [priv] sshd 19864 0.0 0.0 105068 0 ? S Oct09 0:00 sshd: unknown [net]
我想问问这是正常的,还是我的系统受到某种sshpowershell攻击?
谢谢!
是的,这是正常的。 sshd为当前正在尝试authentication的每个用户打开2个新进程。
是的,这很可能表示有人尝试向您的服务器进行身份validation,而这并不意味着这一点。 如果没有的话,可以看看你的/var/log/auth.log
应该指向你的networking中有一个不推荐的cron脚本运行的服务器。
经验法则:如果你担心有人可能进入,那么问题不是人们试图进入! 相反,确保没有人会成功的暴力。
您可以按顺序调整sshdconfiguration,并在某种程度上限制处理这些系统资源的花费。 但是,对于除了最薄的服务器之外的任何设备,这些默认设置都应该是可以的,但这其实并不是什么大问题 。
# Disable unused authentication methods # !! ONLY DISABLE PASSWORDS IF ALL USERS LOGIN USING KEYS !! PasswordAuthentication no # If the above is true, also limit the time users have to present # their authentication # If theres no passwords typed, something <60 seconds is reasonable # !! DO NOT SET TOO LOW! USERS MAY STILL NEED TO UNLOCK THEIR KEY/CARD !! LoginGraceTime 120 # Limit how many times a user can attempt to authenticate # !! Users who initially try the wrong key or invalid method will # !! first need to configure their ssh client properly # !! else they will be locked out if this is too low! MaxAuthTries 6 # Limit the number of concurrently authenticating users # start not accepting some connections if there are already 10 clients # stop accepting any connections if there are already 100 clients # !! one may even argue leaving this high is helpful, because # !! an attacker needs more resources to prevent legitimate connections MaxStartups 10:30:100
你也可以将你的SSH移动到另一个端口,这将大大限制尝试的人数。 我不build议这样做。 这不会提高安全性,而且会使事情更加复杂。
首先我同意@anx所说的。
几件事情要添加(我做的):
教程:如何在centos 7上安装fail2ban