computers:ssh_security
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
computers:ssh_security [2012/02/01 16:25] – chkuo | computers:ssh_security [2023/03/28 14:40] (current) – [Limit by IP address] chkuo | ||
---|---|---|---|
Line 18: | Line 18: | ||
< | < | ||
# / | # / | ||
- | # allow intranet-ethernet | + | # allow intranet IPs (192.168.1.*) |
- | # allow intranet-wireless | + | # allow IPMB IPs (172.*.*.*) |
# allow Academia Sinica IPs (140.109.*.*) | # allow Academia Sinica IPs (140.109.*.*) | ||
- | # allow National Taiwan University IPs (140.112.*.*) | + | sshd: 192.168.1., |
- | sshd: 192.168.1., | + | |
</ | </ | ||
- | Other IP ranges: | + | |
- | * Hinet: 118.160.0.0 - 118.167.255.255, | + | |
===== Check log files ===== | ===== Check log files ===== | ||
Mac: | Mac: | ||
<code bash> | <code bash> | ||
- | more /var/log/secure.log | + | grep sshd /var/log/system.log |
</ | </ | ||
Line 37: | Line 35: | ||
<code bash> | <code bash> | ||
- | more / | + | grep sshd / |
</ | </ | ||
Line 47: | Line 45: | ||
<code bash> | <code bash> | ||
# install | # install | ||
- | sudo apt-get install fail2ban | + | sudo apt install fail2ban |
# edit the conf file / | # edit the conf file / | ||
# for example, increase ' | # for example, increase ' | ||
Line 58: | Line 56: | ||
# check client status | # check client status | ||
sudo fail2ban-client status | sudo fail2ban-client status | ||
+ | sudo fail2ban-client status sshd | ||
# check log | # check log | ||
cat / | cat / | ||
+ | # unban | ||
+ | sudo fail2ban-client set sshd unbanip xxx.xxx.xxx.xxx | ||
</ | </ | ||
+ | If registered at [[http:// | ||
+ | <code bash> | ||
+ | destemail = fail2ban@blocklist.de | ||
+ | sendermail = fail2ban@your-server.tld | ||
+ | </ | ||
computers/ssh_security.1328084722.txt.gz · Last modified: 2012/02/01 16:25 by chkuo