Question

some random ip from india is trying to ssh into my ip all day??

I’ve setup fail2ban according to the tutorial but this indian ip kept trying to authenticate in today after it was banned several times to the point where i increased the ban time for anyone trying to connect after 1 failed attempt to max?

What’s the deal though, this is bad for me. If i make one mistake on my password i’m locked out. Is this guy trying to have me?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@ariziragoran

If you’re on a MacBook, I’d recommend Algo as it’ll handle setting up a VPN for you in a matter of just a few minutes – pretty much hassle free.

https://github.com/trailofbits/algo

If you’re not, or if you’d prefer to handle configuring the VPN on your own, there’s a guide here that details how to go about setting up StrongSwan (which is what Algo uses).

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-ikev2-vpn-server-with-strongswan-on-ubuntu-16-04

Algo will run on Linux and Windows, though my experience with it is limited to OS X / MacOS right now. They do provide instructions on how to set it up on the GitHub page though.

Once a VPN is setup, you’d simply firewall off Port 22 and only allow the static IP of your VPN to connect using:

ufw allow from VPN_IP to any port 22

Where VPN_IP is the IP address of your VPN. Just make sure you’re connected to the VPN when you try to connect :-).

For example, if our VPN IP was 11.222.33.44, we’d run:

ufw allow from 11.222.33.44 to any port 22

Keep in mind, if you disconnect from the VPN, you won’t be able to login. If you delete the Droplet that your VPN is on, you’ll lock yourself out.

hi @ariziragoran ,

You can do many things to improve your security for example:

  • Setup OpenVPN server and use it to access your droplet using the private IP address and disable SSH on the public IP address.
  • You can use knockd to increase your security using a port koncking sequence to open your firewall just for your IP address.
  • You can change SSH port to a non-standard port.
  • You can try to setup firewall to block access from all IP addresses in India.

Hope any of these help you, contact me if you need help with any of them.