Hi All,
Every time When I logged into My SSH, I can see too many Failed Login Attempts...
I was so much continuous about the security of My server.
I won't allow any brute force attackers to steal my password.
As a Learner and Practitioner, I was not having enough knowledge in Linux or Cent OS.
Just Trying Online forums Like this.
Finally, I found a solution to get rid of those Attacks.
Original Post, that Helped me is from here - https://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-centos-7
But, I feel that is Little more complicated for a fresher.
So, I just simplified them.
First of All, You have to log in to your SSH as ROOT.
You can Run this Command to Login as ROOT ( if not already logged in as ROOT )
After login as ROOT
Run These Commands One By One.
1 -
You will be prompted to continue—press y, followed by Enter:
2 -
Again, press y and Enter when prompted to continue.
3 -
4 -
NOW Copy This Below Text and Paste in Your SSH Screen
Press Ctrl-X to exit, y to save, and Enter to confirm
5 -
Now, you can Test the Status
6 -
if the Output Shows like this
then, Everything is OK
Also, Do this Command to get More Info
7 -
These are the Simple Methods I Used to Secure my server using Fail2Ban.
in the above link, You can find more Options. I just Simplified it.
NB: I Learn many new things from this Community. So, I Love to Contribute back to this community. something as I can...
Every time When I logged into My SSH, I can see too many Failed Login Attempts...
I was so much continuous about the security of My server.
I won't allow any brute force attackers to steal my password.
As a Learner and Practitioner, I was not having enough knowledge in Linux or Cent OS.
Just Trying Online forums Like this.
Finally, I found a solution to get rid of those Attacks.
Original Post, that Helped me is from here - https://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-centos-7
But, I feel that is Little more complicated for a fresher.
So, I just simplified them.
First of All, You have to log in to your SSH as ROOT.
You can Run this Command to Login as ROOT ( if not already logged in as ROOT )
Code:
sudo su -
Run These Commands One By One.
1 -
Code:
yum install epel-release
2 -
Code:
yum install fail2ban
3 -
Code:
systemctl enable fail2ban
Code:
nano /etc/fail2ban/jail.local
Code:
[DEFAULT]
# Ban hosts for one hour:
bantime = 3600
# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport
[sshd]
enabled = true
5 -
Code:
systemctl restart fail2ban
6 -
Code:
fail2ban-client status
Code:
Status
|- Number of jail: 1
`- Jail list: sshd
Also, Do this Command to get More Info
7 -
Code:
fail2ban-client status sshd
in the above link, You can find more Options. I just Simplified it.
NB: I Learn many new things from this Community. So, I Love to Contribute back to this community. something as I can...