elearn
By:
elearn

how to protect my vps from cracking?

February 10, 2015 1.1k views

In my console:
cat /var/log/auth.log.1 | grep 'sshd.*Invalid'

There are some many bad egg want to crack my vps.

Feb 8 02:48:21 change sshd[10438]: Invalid user cisco from 23.238.186.135
Feb 8 02:48:21 change sshd[10437]: Invalid user user from 5.231.198.67
Feb 8 02:48:25 change sshd[10441]: Invalid user dave from 23.238.186.135
Feb 8 02:48:27 change sshd[10443]: Invalid user user from 5.231.198.67
Feb 8 02:48:29 change sshd[10445]: Invalid user gis from 23.238.186.135
Feb 8 02:48:32 change sshd[10447]: Invalid user user from 5.231.198.67
Feb 8 02:48:32 change sshd[10449]: Invalid user jeff from 23.238.186.135
Feb 8 02:48:36 change sshd[10452]: Invalid user john from 23.238.186.135
Feb 8 02:48:37 change sshd[10451]: Invalid user user from 5.231.198.67
Feb 8 02:48:40 change sshd[10455]: Invalid user kevin from 23.238.186.135
Feb 8 02:48:43 change sshd[10457]: Invalid user user from 5.231.198.67
Feb 8 02:48:43 change sshd[10459]: Invalid user larry from 23.238.186.135
Feb 8 02:48:46 change sshd[10462]: Invalid user smiley from 23.238.186.135
Feb 8 02:48:47 change sshd[10461]: Invalid user user from 5.231.198.67
Feb 8 02:48:50 change sshd[10465]: Invalid user software from 23.238.186.135
Feb 8 02:48:52 change sshd[10467]: Invalid user user2 from 5.231.198.67
Feb 8 02:48:55 change sshd[10469]: Invalid user steve from 23.238.186.135
Feb 8 02:48:57 change sshd[10471]: Invalid user user from 5.231.198.67
Feb 8 02:48:58 change sshd[10473]: Invalid user virgil from 23.238.186.135
Feb 8 02:49:02 change sshd[10476]: Invalid user walt from 23.238.186.135
Feb 8 02:49:03 change sshd[10475]: Invalid user userftp from 5.231.198.67
Feb 8 02:49:07 change sshd[10479]: Invalid user ajiro from 23.238.186.135
Feb 8 02:49:09 change sshd[10481]: Invalid user userftp from 5.231.198.67
Feb 8 02:49:11 change sshd[10483]: Invalid user arasawa from 23.238.186.135
Feb 8 02:49:14 change sshd[10485]: Invalid user userftp from 5.231.198.67
Feb 8 02:49:14 change sshd[10487]: Invalid user asai from 23.238.186.135
Feb 8 02:49:18 change sshd[10490]: Invalid user ayase from 23.238.186.135
Feb 8 02:49:19 change sshd[10489]: Invalid user userftp from 5.231.198.67
Feb 8 02:49:21 change sshd[10493]: Invalid user coupon from 23.238.186.135
Feb 8 02:49:24 change sshd[10495]: Invalid user userftp from 5.231.198.67
Feb 8 02:49:26 change sshd[10497]: Invalid user daikanyama from 23.238.186.135
Feb 8 02:49:29 change sshd[10499]: Invalid user ebata from 23.238.186.135
Feb 8 02:49:32 change sshd[10501]: Invalid user userftp from 5.231.198.67
Feb 8 02:49:32 change sshd[10503]: Invalid user hayatsu from 23.238.186.135
Feb 8 02:49:36 change sshd[10506]: Invalid user inada from 23.238.186.135
Feb 8 02:49:37 change sshd[10505]: Invalid user userftp from 5.231.198.67
Feb 8 02:49:40 change sshd[10509]: Invalid user isamu from 23.238.186.135
Feb 8 02:49:41 change sshd[10511]: Invalid user userftp from 5.231.198.67
Feb 8 02:49:44 change sshd[10513]: Invalid user kido from 23.238.186.135

How can i do ?

6 Answers

Setup a ssh key (you can do that on droplet launch or manually) and remove use of passwords on sshd, they can try till the earth froze with no success.

Add firewall rules to only allow SSH connections from your known IP addresses

But my ip address will change everytime i logon in my web, can i add a firewall rules that only my own mac address can logon in the ssh connection .

I have successfully used the `recent' iptables module to deal with this problem.

Refer http://blog.zioup.org/2008/iptables_recent/ for an example of how to do it. Tune the numbers according to your tastes.

You can change default ssh port. or use only two factor authentication.

Have another answer? Share your knowledge.