https://github.com/github0null/ssh_guard
ssh 防爆破,自动将 ip 加入黑名单
https://github.com/github0null/ssh_guard
guard sshd
Last synced: 11 months ago
JSON representation
ssh 防爆破,自动将 ip 加入黑名单
- Host: GitHub
- URL: https://github.com/github0null/ssh_guard
- Owner: github0null
- Created: 2021-02-03T03:08:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-24T07:09:14.000Z (over 3 years ago)
- Last Synced: 2025-03-26T22:04:09.165Z (11 months ago)
- Topics: guard, sshd
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 简述
运行该脚本,会检查 ssh 的登陆失败记录,将超过尝试次数(默认3)的 ip 加入到黑名单 `/etc/hosts.deny`
***
## 安装
1. 安装 Python3
2. 将 src/main.py 复制到你的服务器中某个目录中
3. 使用命令编辑定时任务 `vim /etc/crontab`,添加如下任务:
```ini
# 每隔 2 min 运行一次 ssh_guard
*/2 * * * * root python3 //main.py >> //sshd_guard.log 2>&1
```