Skip to main content

Last failed login: Fri May 1 23:31:22 CST 2021 from xxx on ssh:notty There were 187 failed login attempts since the last successful login.

In the morning, I noticed somebody wants to visit our host. They tried so many usernames and passwords.

I used a command to check the records of visit:

lastb -100

So many records displayed on the screen.


We can install fail2ban to protect our host.


For centos

yum install epel-release
yum install -y fail2ban
systemctl enable fail2ban


# check Fail2ban's status
fail2ban-client status
# check Fail2ban's status of sshd
fail2ban-client status sshd

# check Fai2ban's version
fail2ban-client version

# check Fail2ban if run or not
fail2ban-client ping

# start Fail2ban
fail2ban-client start

# stop Fail2ban
fail2ban-client stop

# restart Fail2ban
fail2ban-client restart

# open Fail2ban's log
tail -f /var/log/fail2ban.log

Comments

Popular posts from this blog

The scorecard for becoming an international person on August 7, 2024, is as follows.

  The scorecard for becoming an international person on August 7, 2024, is as follows. My name is Shane. I am a Full Stack Engineer with over 16 years of experience in the software development industry. I have developed and maintained Java applications using Spring Boot, Mybatis, Vue, and Maven, as well as IntelliJ IDEA, my favorite IDE. I am enthusiastic about technology. I also like Chinese culture, and I would like to upload some videos on Youtube for sharing the good things with you. LinkedIn: https://www.linkedin.com/in/xingjun-chen/ Github: https://github.com/chenxingjun Youtube: https://www.youtube.com/@jinxuezhai Schedule Goals Review Personal development Target: Learning: 1 hour, Practicing: 1 hour, Working: 8 hours Morning: Learning, working Afternoon: Practicing, working Evening: Practicing, reading books Others Finance Relationships Family, friends, others Scorecard Goals Seeking a remote developer job. July ...

The scorecard for becoming an English person on Monday, July 15, 2024, is as follows.

  The scorecard for becoming an English person on Monday, July 15, 2024, is as follows. My name is Shane. I am a Full Stack Engineer with over 16 years of experience in the software development industry. I have developed and maintained Java applications using Spring Boot, Mybatis, Vue, and Maven, as well as IntelliJ IDEA, my favorite IDE. I am enthusiastic about technology. I also like Chinese culture, and I would like to upload some videos on Youtube for sharing the good things with you. LinkedIn: https://www.linkedin.com/in/xingjun-chen/ Github: https://github.com/chenxingjun Youtube: https://www.youtube.com/@jinxuezhai Schedule Goals Review Personal development Target: Learning: 1 hour, Practicing: 1 hour, Working: 8 hours Morning: Learning, working Afternoon: Practicing, working Everning: Practicing, reading books Others Finance Relationships Family, friends, others Scorecard Goals Remote job. July Developer I wou...

The scorecard for becoming an English person on Tuesday, July 2, 2024, is as follows.

  The scorecard for becoming an English person on Tuesday, July 2, 2024, is as follows. My name is Shane. I am a Full Stack Engineer with over 16 years of experience in the software development industry. I have developed and maintained Java applications using Spring Boot, Mybatis, Vue, and Maven, as well as IntelliJ IDEA, my favorite IDE. I am enthusiastic about technology. I also like Chinese culture, and I would like to upload some videos on Youtube for sharing the good things with you. Schedule Goals Review Personal development Weekday Morning: Learning, working Books: 1 hour, technologies: 1 hour Afternoon: Practicing, working Martial arts: 0.5 hour Everning: Practicing, reading books Chinese Xiao flute: 0.5 hour Others Finance Weekend Morning: Learning, working Books: 0.5 hour, technologies: 0 hour Afternoon: Practicing, working Martial arts: 1 hour Everning: Practicing, reading books Chinese Xiao flute: 1 ...