How to secure a linux VPS?

BlueCola

Verified User
Joined
Jan 12, 2012
Messages
72
3 days ago, my VPS got hacked by someone, and formatted my server. I buyed a new VPS, and with back-ups, I migrated my users to this new server. My new server seems to run perfectly.

But I can't find out how they got it anymore, they deleted all of my data. How do I make sure this can't happen again? I'm already running CSF+LFD, and have moved my SSH to a non-standard port. I'm also considering PubKeyAuth for root access now. But i'm still wondering how the hell this could happen. What can I do more to prevent this next time? Whay do you guys do, to secure your VPS? Im running CentOS 6.0 btw.
 
I forgot one question (can't edit on this forum?): First the hacker changed my /home/admin/domains/default/index.html to a index.html with an weird link/script to a trojan horse. With the backup / restore function, I imported this file as well on my new server. I immediately deleted it after I saw this. Can a html file in the /home/admin/ folder create a backdoor or virus to/for my server?
 
Hello,

I doubt you need somebody's guesses. It's now impossible to say how did you get hacked. So you'd better check your user homedirs, there might be a Web Shell, or other malicious scripts.

Read this
http://help.directadmin.com/item.php?id=247
http://www.directadmin.com/features.php?id=961
http://www.directadmin.com/forum/showthread.php?t=40009&page=1
http://www.google.com/search?q=securing+server+site:directadmin.com

Note, these links I gave you for reading only purposes. I do not guarantee that ideas mentioned there would work (or not) for you in your particular case. So you need to read more information about security and think your head, it's not a question of using any How-To, as things change, and guides loose their actuality. You might want to hire somebody to secure your server and make an audit: you choose from guys from your DC and some of us here, who can give you a commerce service.
 
Back
Top