Block all IPs trying to hack

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
ComputerDoctor2010
New to forums
New to forums
Posts: 2
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Tue Aug 05, 2014 6:03 am

Block all IPs trying to hack

Post by ComputerDoctor2010 »

Is there a way to block all IPs except for my own IP? I have been having a lot of IPs trying to gain access to my machine.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Block all IPs trying to hack

Post by soja »

Not a NFO employee
ComputerDoctor2010
New to forums
New to forums
Posts: 2
Joined: Tue Aug 05, 2014 6:03 am

Re: Block all IPs trying to hack

Post by ComputerDoctor2010 »

I tried doing that and I am still able to remote desktop from other IP addresses. :cry:
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Block all IPs trying to hack

Post by soja »

Which port did you block?
Not a NFO employee
User avatar
rymax99
This is my homepage
This is my homepage
Posts: 143
Joined: Sun Feb 02, 2014 2:08 pm
Location: Florida
Contact:

Re: Block all IPs trying to hack

Post by rymax99 »

You can easily change your SSH port which gets rid of most brute force attempts as SSH won't be running on the port they're brute forcing.

To do this all you have to do is login as root and edit '/etc/ssh/sshd_config' - search for the line that has 'Port 22' - change the port to something else. I would recommend you change it to something high to avoid port scanners finding it, but it must be below 65535. After you change it, if you're on Debian/Ubuntu, run 'service ssh restart', if you're on CentOS, run 'service sshd restart'.

For further security, you could install something like fail2ban that automatically firewalls IPs that fail a set number of logins.
Post Reply