Block all IPs trying to hack
-
ComputerDoctor2010
- 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
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.
-
ComputerDoctor2010
- New to forums

- Posts: 2
- Joined: Tue Aug 05, 2014 6:03 am
Re: Block all IPs trying to hack
I tried doing that and I am still able to remote desktop from other IP addresses. 
Re: Block all IPs trying to hack
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.
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.
