Skip to content

Linux服务器的安全脚本,自动将试图暴力破解你机器密码的ip加入到黑名单

Notifications You must be signed in to change notification settings

yongxin-ms/secure_ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

secure_ssh

linux机器的安全脚本,实现ssh访问控制,多次失败登录即封掉IP,防止暴力破解

你的vps很可能正在被暴力破解密码

如果你的机器是Centos,去看看/var/log/secure

如果你的机器是Ubuntu,去看看/var/log/auth.log

解决方法

在Centos机器上运行run_centos.sh

在Ubuntu机器上运行run_ubuntu.sh

添加到你的crontab中,让脚本每分钟运行一次

* * * * * root /home/will/.local/secure_ssh/run_ubuntu.sh

这样暴力破解你密码的ip会进入到hosts.deny黑名单中,以后他就不能再登录了

为了防止你自己登陆失败,需要在hosts.allow白名单中加入你自己的ip,形如:

sshd:10.0.0.:allow

About

Linux服务器的安全脚本,自动将试图暴力破解你机器密码的ip加入到黑名单

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy