TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: My Linux server was hacked

5 点作者 yuashizuki大约 10 年前
I dont understand how my linux server got hacked? the ssh key was also compromised. I have switched the server off and plan to reinstall a new linux distribution. I also changed my profile password of linode. Do I need to do anything else to protect my self again? Thanks for reading.

4 条评论

jfaucett大约 10 年前
Linode has a great guide for locking down your server, if you don&#x27;t do anything else at a bare minimum do this (<a href="https:&#x2F;&#x2F;www.linode.com&#x2F;docs&#x2F;security&#x2F;securing-your-server" rel="nofollow">https:&#x2F;&#x2F;www.linode.com&#x2F;docs&#x2F;security&#x2F;securing-your-server</a>).<p>I can remember many many moons ago I got hacked too so I know the feeling. If you don&#x27;t have mission critical stuff, this can be a good thing though, makes you learn how to lock down your servers.<p>Besides locking down your SSH config, Fail2Ban is nice, and be sure to set your iptables so your only accepting packets you want. Also here&#x27;s a list of other things I usually do:<p>1. Depending on your distro there&#x27;s usually a way to install automatic security updates, in debian its called unattended upgrades (<a href="https:&#x2F;&#x2F;wiki.debian.org&#x2F;UnattendedUpgrades" rel="nofollow">https:&#x2F;&#x2F;wiki.debian.org&#x2F;UnattendedUpgrades</a>)<p>2. Install logwatch to keep yourself periodically updated with whats going on.<p>3. Control your packages. If you don&#x27;t need services make sure your box is clean of them. Basically, for every service you have on the machine thats one more possible attack point, so just use the ones you know you need.<p>4. In your firewall ignore icmp_echo and icmp_echo_ignore_broadcasts if you can. There&#x27;s also other stuff you can do in sysctl and with SELinux but I&#x27;ve never really had the need.
评论 #9420847 未加载
Corrspt大约 10 年前
Hey, that&#x27;s a bummer. I&#x27;ve been in the same situation about a year ago (I thought I had done a reasonable job of securing my instalation but they hacked my web application through a vulnerability in jboss)<p>I blogged about it and posted on reddit. Lot&#x27;s of people gave me useful feedback (checkout this link <a href="http:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;1vo7zv&#x2F;kids_this_is_story_of_how_i_met_my_vps_hacked&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;1vo7zv&#x2F;kids_thi...</a>)<p>I&#x27;d recommend (as others have said here) disabling password login via SSH (only keys), disable root login, installing fail2ban, update the system regularly, setup firewall to close ports that don&#x27;t need to be open.
penguinlinux大约 10 年前
did your server had any type of website running ? such as open source projects installed ? any services or ports running and available to the outside world. Did you have a website running with code you wrote?<p>Out of the box a fresh ubuntu server is pretty secure so you had to install something that exposed some type exploitable code and that&#x27;s how they got access to your machine.
评论 #9416849 未加载
pipu大约 10 年前
How did you secure your server?<p>How do you know it got hacked?
评论 #9416818 未加载