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

Posted May 18, 2017 4.7k views

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?

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.

Submit an Answer
2 answers

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.

by Justin Ellingwood
Port knocking is a method of protecting your services behind a firewall until connection attempts are made to a specific sequence of ports in a certain amount of time. The firewall rules are then modified to allow access to the service and the user can connect as normal. In this article, we will discuss how to implement port knocking to add an extra layer of protection to your SSH daemon in order to dissuade attackers.


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.

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).

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, we’d run:

ufw allow from 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.

by Namo
A virtual private network, or VPN, allows you to securely encrypt traffic as it travels through untrusted networks, such as those at the coffee shop, a conference, or an airport. IKEv2, or Internet Key Exchange v2, is a...