Slashdot Log In
Hardening Linux
Posted by
CmdrTaco
on Sun Aug 12, 2007 09:28 AM
from the you-know-you-should dept.
from the you-know-you-should dept.
davidmwilliams writes "Out of the box, many Linux systems are insecure with open ports and unpatched vulnerabilities. Read about the essential steps to
secure your server as well as how to solve them manually and via automated tools like Bastille."
Related Stories
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.

FP (Score:4, Funny)
I'm not sure what this is doing on /. (Score:1, Funny)
How To in summary... (Score:5, Informative)
(http://www.ibboard.co.uk/)
1) Disable unwanted services (done via the CLI in this day of GUIs)
2) Keep the OS patched
3) Install and run Bastille to do everything else for you.
Re:How To in summary... (Score:5, Insightful)
(http://www.jessta.id.au/)
gentoo has great service management
GUI tools are seriously annoying, since this article is about security and disabling unneeded services having config tools that require the unneeded service X11 is pretty silly.
Re:How To in summary... (Score:4, Insightful)
That's because the article fell through a hole in time, and actually belongs in 1997. They are already yelling to give their article back. No self-respecting consumer distro has shipped with open ports in ages.
Re:How To in summary... (Score:5, Funny)
(http://trolltalk.com/ | Last Journal: Saturday November 03, @08:45PM)
The summary is ... strange.
"... many Linux systems are insecure with open ports" ... "...how to secure your server ..."
Remember all those internet ads about "YOUR COMPUTER HAS OPEN PORTS !!!"
Its a computer connected to "Teh Intarweb" - its supposed to have open ports.
Next we'll read another story about how some "1337 hacker hacked into another person's machine" at IP address 127.0.0.1, erased all their files, and somehow, the "other person" was able to hack their machine and do the same thing ...
Followed by a nostalgiac look at "Punch-the-monkey" ads.
Dude, that article sucked. (Score:5, Insightful)
It reads more like someone who's just discovered Bastille and now considers himself "informed" on "security issues".
Step #1. Limit the avenues of attack. This is where you'd use nmap.
Step #2. Remove anything you don't absolutely need. Come on, most people out there will be running some distribution now. At least he could have covered dpkg, rpm, etc.
What's this with the "Enter kill -9 xxx where xxx is the PID."? How about just
And editing xinetd.conf / inetd.conf? Again, just use the package manager to remove it.
And he doesn't even go into how each distribution handles package updates? What the fuck? Nothing about "apt-get update"? No "apt-get upgrade"?
No, this article is about someone's discovery of Bastille and how it helps an old, stock installation of Red Hat.
That's a good point. Thanks. (Score:5, Interesting)
Yep. That's why I prefer hitting it from a different machine. Multiple machines if possible. One on the same LAN segment and one from somewhere on the Internet.
That way you'll see what a would-be-attacker will see.
Sure, I might be running SMTP on port 25, but bound to 127.0.0.1 instead of eth0. An attacker would have to FIRST gain access to my machine through some other means to be able to attack my SMTP service.
Sure, that first hurdle might be set very, Very, VERY, VERY high, but if someone can get over it
And that's what "security" is all about to me. It's the PROCESS of evaluating threats and reducing their effectiveness.
This is the last time I'm explaining it to you. (Score:5, Informative)
Maybe it does. Maybe it does not. But that is immaterial. This is about what an attacker would see. Not what your machine can see from itself.
It is possible to set up a system that allows access to those services from eth0 & localhost, but not from any other addresses.
You are not concerned about what you can see from your machine. You are concerned about what an attacker can see. They are NOT the same.
NO it will NOT.
Your statement is only accurate for the condition in which NO ports are open. That is a single scenario and does NOT account for the various possibilities. Therefore the ONLY way to know what an attacker would see is to scan the way the attacker would.
No. Again, the system can be set up so that the ports are visible from localhost and eth0. The only way to know EXACTLY what the attacker can see (other than in the specific scenario of all ports being closed) is to scan the way the attacker would.
No, the list given by nmap would not be accurate. Because the list given by nmap would show ports open (and therefore vulnerable) when there would be no way for an attacker to see those ports.
Again, the only time your statement would be accurate is the single case of all ports being closed.
I've given multiple, specific examples where such would not be the case. I've shown where your statement is correct ONLY FOR A SINGLE SCENARIO where all the ports are closed.
Again, I've provided specific examples that illustrate where the information gained by scanning from an attacker's position would be different than scanning from the machine itself.
You can claim that such is impossible all you want.
But the facts contradict you.
You are taking a single case and claiming that it is the same for ALL the possible configurations. It is not. The only way to know what an attacker will see is to perform the scan as an attacker would.
AppArmour (Score:3, Interesting)
Hmmmm (Score:1, Insightful)
Ipchains? (Score:1)
(Last Journal: Sunday May 20, @05:49PM)
Huh? (Score:1, Redundant)
Re:Huh? (Score:5, Informative)
(http://www.zocalo.uk.com/)
A default Ubuntu box has them all closed. (Score:4, Informative)
That is correct. By default, they are all closed.
But you may have changed that. If you've installed any P2P or such apps, you may have open ports from that.
As the other poster suggested, use nmap to determine what your outward profile looks like. Even better, have a friend scan your address from their location. That will tell you what your machine looks like from the Internet.
That's without a firewall.
In Soviet Russia (Score:2, Funny)
Bastille hompage (Score:2)
(http://in2mind.blogspot.com/)
Open Ports? (Score:2)
(http://www.kibbee.ca/)
Per-distro comparisons? (Score:5, Interesting)
Anyone know of such a project - even if just comparing a few top-tier distributions?
Re:Per-distro comparisons? (Score:4, Insightful)
Hardened Linux From Scratch (Score:3, Interesting)
Open ports and unpatched vulnerabilities? (Score:2)
Article not very informative (Score:5, Informative)
Run 'netstat -apvtu' if you're worried about what you have open. A good ingress/egress firewall policy is ideal and any competent Linux user should be forced to learn iptables instead of relying on a GUI or automated configuration tool to make assumptions about the purposes of your network.
The article isn't very useful or accurate.
Box? (Score:5, Insightful)
(http://www.thetao.info/tao/whitecloud1.htm)
Before making a claim like that, the writer should come up with at least three examples, from current versions of major distros.
Reminds me of a local woman who said "We must have a town-wide neighborhood watch, because there's a child sexual predator on every block." In the several years since she raised that hysteria, there's been exactly one serious case in town: one of her best friends had his extensive child porn collection found by the police. He hired the state's most expensive lawyers and got off with probation. She's still his best friend.
Back to the topic. The article mentions telnet. Is there a single current distro that comes with telnetd enabled? Let's help the sloppy author. Has anyone here installed any current distro and found "open ports and unpatched vulnerabilities"?
Hardened? Hardly. (Score:4, Informative)
So what - we are all NAT'ed anyway? (Score:2)
(http://www.stopcomputerlicens.dk/ | Last Journal: Wednesday August 01, @08:24AM)
Since the submitter is also the author... (Score:4, Funny)
Here's how I'm picturing it:
(editor) Mr. Williams, we need a techie article on Linux.
(mr. williams) Okay... I haven't touched linux since I played around with my RedHat 7.2 box 3 years ago.
(editor) Do you still have it?
(mr. williams) Yes, what would you like me to write about it?
(editor) Write something up on securing its "holes and vulnerabilities", and we'll sensationalize it a bit by making it look like Linux is insecure out of the box.
(mr. williams) I don't know how to do that.
(editor) Find something on google. Try it on your RedHat machine.
(mr. williams) I'm going to look really stupid.
(editor) You're a journalist.
The defaults are no longer what they were in 199x (Score:5, Informative)
- [KU]buntu
All services off by default. netfilter rules are default allow however, but there is
nothing to connect to.
- Fedora/RHEL/CentOS
Choose during install what services you want enabled/open/firewalled.
SELinux enabled by default.
- Knoppix 5.1.1
Only Port 68 for dhcp client listener.
- Mandriva 2007 Bootable CD
Port 6000 is all that's open (X server. Ok this is dumb, why?)
Other distros follow similar suit. You can find out what's running on your linux box with:
- netstat -tuna (all tcp/udp sockets, dont resolve names, all listening/non-listening sockets)
- locate iptables; sudo iptables -nvL (show iptables chains for netfilter)
Chances are, if you've not mucked around with the default services things are pretty tight.
TFA is a bit inaccurate for linux systems these days.
newbie article (Score:3, Interesting)
Redhat 7.0, ipchains? (Score:2)
Why doesn't linux come "closed" out of the box (Score:1)
some wizards with a few different, and mostly conservative, minimalist options
for opening things up, explaining the cost-benefit of the options.
I suppose it's just inertia combined with Unix/Linux's pre-internet-malevolence
origins. The whole idea originally was for a number of socially responsible researchers
to have their computers maximally cooperating with each other (go figure). It wasn't designed
with human viruses (malicious crackers) in mind at the get-go.
But we've had net morons long enough now that you'd think a closed and incrementally
open up policy would be a no-brainer for the default installations of net-facing OSes like
Linux.
Secure wget! (Score:2)
The simplest way, then, to prevent script kiddies from compromising your system is not only allow access to wget through sudo! Simply chmod it.
Now, this is no excuse not to ensure everything else is up to date, etc. But a simple chmod can make an enormous difference to the security of your system.
Hardening Linux (Score:5, Funny)
(http://santanatechnotes.blogspot.com/)
Bind services to localhost. (Score:2)
(http://www.scarydevil.com/~peter/ | Last Journal: Monday September 26 2005, @06:53PM)
Installing Debian server (Score:3)
Use nmap? (Score:3, Insightful)
i'm secure, too (Score:1)
Hardening? Wha? (Score:1)
Now from those people, should they exist, is there anyone actually skilled in security?
From this now impossible subset, why aren't we just moving to openbsd?
I'm a windows based engineer, and every time I look at linux I see the same great gaping security holes as the core system I use and less usability. So I stay with windows, where its easy. And strangely enough all my bastion hosts are Theo's work.
rofl (Score:1)
Source is an interesting one (Score:1)
(http://winstone.sourceforge.net/)
Re:Lots of linux stories on the front page (Score:1)
Seriously.
Re:Lots of linux stories on the front page (Score:1)
Re:Lots of linux stories on the front page (Score:2)
Re:Lots of linux stories on the front page (Score:2)
(http://trolltalk.com/ | Last Journal: Saturday November 03, @08:45PM)
Well, if you're looking for something that's "not linux", you can always enter this contest [trolltalk.com] - there are already a few entries that cover "open ports" that have nothing to do with linux - and one (# 12) that really nails "hardening" pretty good.
"The purpose of this post is to see the reasoning behind so many linux fluff stories making front page "
Its Sunday, this is slashdot, not PC Magazine, CmdrTaco is stuck reviewing submissions over dialup, and the big news of the MONTH was SCO getting kicked in the nuts. [youtube.com] - but at least they got more than the $20 that guy got. Hopefully one or two will also get prison, but I'm not holding my breath.
Maybe they can turn the whole SCO fiasco into a tv show, like this kicked in the nuts [youtube.com] video, but in reverse - have Darl wear the orange clown wig and PAY people $699 each to kick him.
Re:Lots of linux stories on the front page (Score:2)
Re:Lots of linux stories on the front page (Score:2)
Re:Lots of linux stories on the front page (Score:2)
(http://www.pembo13.com/)