Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I fixed the issue. hacker was blocked with no harm.
I hope you understand that we view such claims somewhat skeptically unless backed up by an explaination/evidence. The sad truth is that most of these kinds of threads end up with the OP sticking their head in the sand and pretending that everything is OK. I know you've said that this box isn't particularly important, but if you've treated the symptoms instead of solving the problem, your machine and network could still be at risk.
I hope you understand that we view such claims somewhat skeptically unless backed up by an explaination/evidence. The sad truth is that most of these kinds of threads end up with the OP sticking their head in the sand and pretending that everything is OK. I know you've said that this box isn't particularly important, but if you've treated the symptoms instead of solving the problem, your machine and network could still be at risk.
I agree with Hangdog42.
If you're sick and you take something that keeps you from sneezing, you're STILL sick...you're still contagious. Your focus should be aimed at getting rid of the sickness instead of trying to get rid of the symptoms.
It is nice that is is all fixed, what security measures have you now taken to stop this from happening again, a few things I know from your post, someone was able to login as root through ssh, which means root logins through ssh was not disabled. Your root account on the machine was not disabled and had a weak password, otherwise they wouldn't have bee able to log in as root in the first place. You should add a user to the sudoers file to give them root privileges and then disable the root account. I suspect the firewall wasn't configured properly, allowing a user from anywhere to have access to the ssh port, unless you really need users to have access, and they don't have a static ipaddress, otherwise best to configure iptables to allow only from specific address to have access to ssh port
a few things I know from your post, someone was able to login as root through ssh, which means root logins through ssh was not disabled.
You know this how? The OP posted a few who listings that did indeed show root logged in, but no evidence that it was the cracker. The only evidence I see that the cracker attained root is that they were able to create a new account.
Quote:
Your root account on the machine was not disabled and had a weak password, otherwise they wouldn't have bee able to log in as root in the first place.
I'm not trying to be confrontational, but there is zero evidence for this. When dealing with intrusions, we prefer to deal in facts please.
Quote:
You should add a user to the sudoers file to give them root privileges and then disable the root account
Personally I see no advantage to this approach over a properly run root account. Security by obscurity never really accomplishes much.
Quote:
I suspect the firewall wasn't configured properly, allowing a user from anywhere to have access to the ssh port, unless you really need users to have access, and they don't have a static ipaddress, otherwise best to configure iptables to allow only from specific address to have access to ssh port
While I agree on the utility of limiting ssh access, again, there is absolutely zero evidence that ssh was the vector of attack.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.