News for hackers. Stuff that matters.
Re:Securing your Linux web server by Sir_Cmpwn on Tuesday February 20, 2018 @10:59AM (#16421276)
I have a little checklist I use to cover the basics:

https://drewdevault.com/new-server.html

Re:Securing your Linux web server by rodolphoarruda on Tuesday February 20, 2018 @11:20AM (#16421440)
I'm a generalist project manager.

When you say "Disable password login via ssh", what is going to be the login method from this point onwards? Via a personal certificate? Tks

Re:Securing your Linux web server by brobinson on Tuesday February 20, 2018 @11:26AM (#16421490)
You should be using public key authentication: https://www.digitalocean.com/community/tutorials/how-to-set-...

If you insist on using passwords, make sure you at least install something like fail2ban or denyhosts to block the compromised machines which are hammering your server trying to guess passwords. Clients can see which authentication methods are allowed so they know which machines to attack (i.e., yours, if you allow passwords).

Re:Securing your Linux web server by MertsA on Tuesday February 20, 2018 @12:01PM (#16421816)
Or for something even cleaner than a program trying to parse plaintext logs you can use a PAM module. https://wiki.archlinux.org/index.php/Pam_abl
Re:Securing your Linux web server by adfskjldsjfk on Tuesday February 20, 2018 @08:47PM (#16426149)
How would you compare it with fail2ban?
Re:Securing your Linux web server by Sir_Cmpwn on Tuesday February 20, 2018 @11:26AM (#16421486)
~/.ssh/authorized_keys, which is basically personal certificates.
Re:Securing your Linux web server by zmyrgel on Tuesday February 20, 2018 @01:08PM (#16422429)
Or just use actual SSH certificates instead of public keys so you don't need to have authorized_keys file at all.
Re:Securing your Linux web server by Eupolemos on Tuesday February 20, 2018 @11:31AM (#16421533)
SSH with keys.

I used this ancient video to get going: https://www.youtube.com/watch?v=Fatbs4eTdJE

Re:Securing your Linux web server by madez on Tuesday February 20, 2018 @03:22PM (#16423828)
I use a gpg smartcard to log into SSH. That way I don't need a password (technically, the smartcards reader wants the PIN, but the computer sees no PIN) and the key can't be stolen easily.
Re:Securing your Linux web server by AFNobody on Tuesday February 20, 2018 @11:29AM (#16421521)
I suggest you setup an account on Github and then create a SSH key with a passphrase:

https://help.github.com/articles/generating-a-new-ssh-key-an...

https://help.github.com/articles/testing-your-ssh-connection...

SSH Keys are substantially more secure than passwords.

Re:Securing your Linux web server by Sir_Cmpwn on Tuesday February 20, 2018 @11:31AM (#16421532)
What does GitHub have to do with it?
Re:Securing your Linux web server by AFNobody on Tuesday February 20, 2018 @01:07PM (#16422412)
Its a free way to test he knows how to use SSH w/o a SSH server to talk to on the other end.
Re:Securing your Linux web server by madez on Tuesday February 20, 2018 @05:13PM (#16424731)
One can simply start an openssh-server on localhost with some unused port for testing. There is no need for the internet, other computers or let alone other computers from somebody else over the internet for that.
Re:Securing your Linux web server by moondev on Wednesday February 21, 2018 @01:22PM (#16431617)
Yeah I'm sure they are running linux. Actually just have them build openssh from source first. Much easier then signing up for GitHub and following their guide to do a test push for a litmus test.
Re:Securing your Linux web server by AFNobody on Wednesday February 21, 2018 @02:39PM (#16432293)
The person in question is a project manager and may be using something other than linux or mac.
Re:Securing your Linux web server by rodolphoarruda on Tuesday February 27, 2018 @12:20PM (#16475573)
I use Ubuntu Gnome. The company I work for does not use any OS other than Linux.
Re:Securing your Linux web server by AFNobody on Tuesday February 20, 2018 @11:26AM (#16421494)
My list is similar but I do a UFW setup and move SSH to a non-standard port that is easy to remember (i.e. 12345) to reduce noise in my log files.

Is there any particular reason you left firewall setup off?

Re:Securing your Linux web server by Sir_Cmpwn on Tuesday February 20, 2018 @11:35AM (#16421579)
I don't think firewall is terribly important. I know it's kind of against the grain, probably best to do it if you don't understand the consequences.
Re:Securing your Linux web server by brianjking on Tuesday February 20, 2018 @12:18PM (#16421971)
Changing the default SSH port is a great idea too.
Re:Securing your Linux web server by KeybInterrupt on Tuesday February 20, 2018 @02:24PM (#16423257)
Yeah, it is security through obscurity, I do it anyway on my Internet facing systems because then I don't have to bother with most automated SSH Scanners.
Re:Securing your Linux web server by newbear on Tuesday February 20, 2018 @11:22AM (#16421454)
The general advice I've seen is to not host your own server. But I think it would be a great learning experience. If you cover the basics, is your server still extremely vulnerable?
Re:Securing your Linux web server by madez on Tuesday February 20, 2018 @12:14PM (#16421930)
Who is giving the advice to not host your own server?

My advice is to do host your own server.

Re:Securing your Linux web server by peterwwillis on Tuesday February 20, 2018 @01:36PM (#16422671)
Yep, you should definitely host your own server. And build your own Linux distro. And your own computer. Then weave your own cloth, sew your own clothes, cobble your own shoes. Build a car. Buy some land. Build a house. Move to the country. Raise chickens. Till and sow land. Get off the grid. Abandon the modern world.

It's perfectly possible to drive a car without building one, or to become technically proficient without hosting your own server. If you DIY something, you may learn a lot about it, but it won't make you any better at the thing you actually wanted to do with it.

Re:Securing your Linux web server by madez on Tuesday February 20, 2018 @03:17PM (#16423785)
It is not about learning everything by doing it yourself from scratch. Hosting a service yourself on your own server is becoming simpler and simpler by the day. Capable hardware is cheaply available in the form of single board computers and projects like Freedombox[0] and Yunohost[1] make the hosting part simple for the services they preconfigure.

I don't know why you write such a confrontative comment. Hosting your server is important to have control over your data. You don't need to build your own Linux distro for that...

[0] https://freedombox.org/

[1] https://yunohost.org/

Re:Securing your Linux web server by dvtv75 on Tuesday February 20, 2018 @06:12PM (#16425185)
Yup, I have an Odroid X running Ubuntu (I couldn't find a Debian that was set up to run on it). It's my mail server, apache server, has an outward facing SSH server, and acts as a sensor data logger. It's pushed pretty much as far as it will go, for a little system like that, with a fairly high load average at times.

Recently had a power cut that killed the system, but rather than reinstall I poked around for a few hours until I discovered the bootloader's zImage had been corrupted. Copied another over from the original install image, and away it went.

When I find myself a decent job, I'll dedicate a more powerful system to the task, maybe virtualize a few of the servers.

Fun projects, although there are many head-hit-keyboard moments in setting it up.

Re:Securing your Linux web server by madez on Tuesday February 20, 2018 @06:20PM (#16425248)
I have an A20-Olinuxino-Micro with a battery, so the device can cleanly shutdown when power is lost.

I strongly recommend only buying devices that are compatible with Debian main, or mainline Linux at least. Usually I just check if it's compatible with Debian main, and if it's not, I move on. The latest shiney SoC is not worth the software pain caused by uncooperative manufacturers.

Re:Securing your Linux web server by newbear on Friday February 23, 2018 @03:57PM (#16449566)
Cool, and as to whether basic security will keep my server safe?
Re:Securing your Linux web server by peterwwillis on Tuesday February 20, 2018 @06:41PM (#16425406)
First of all, it wasn't a confrontational comment, it was irony.

And no, self-hosting does not help you control your data. Control would imply some kind of access control or lock, which all hosted services provide. Privacy would imply encryption, which you should be applying to your self-hosted service's files anyway, and can also apply to a hosted service.

Re:Securing your Linux web server by davvolun on Wednesday February 21, 2018 @04:52PM (#16433304)
It came off as confrontational to me..., and I don't see the irony (may be poor choice of word on that though, reductio ad absurdum perhaps?)

I would think someone working in marketing at American Apparel or some fashion magazine or something could get something useful in weaving their own cloth or sewing their own clothes. Similarly towards someone reading Hacker News and running their own server.

Re:Securing your Linux web server by madez on Wednesday February 21, 2018 @06:20AM (#16428644)
It was confrontational because you ridiculed a point of what I said by extremely overdoing it.

Even the part you ridiculed — which wasn't the main point — is important. Learning and figuring stuff out by doing it yourself is very important. One doesn't need to go to the absurdly extreme like you ironically promoted.

I host my own server and virtually only I have access to it. Clearly, that gives me privacy to a large degree.

Re:Securing your Linux web server by NinjaKitten on Tuesday February 20, 2018 @02:00PM (#16422964)
You could have said that without the snark.
Re:Securing your Linux web server by moftz on Tuesday February 20, 2018 @11:35AM (#16421571)
Not host your own hardware or not get a dedicated server? Whether you host your own hardware in your home or rent a dedicated server, you are still responsible for proper security. Renting a VPS is a different story, you are relying on the hosting company to properly setup security for the guests. At least when you can run on bare metal, you can audit yourself. If I need to be able to quickly scale and do other "cloud computing" things, running EC2 or similar instances is pretty much the only way but if I need some real security, hosting on my own is the best option.
Re:Securing your Linux web server by Sir_Cmpwn on Tuesday February 20, 2018 @11:25AM (#16421479)
No, not really. I host plenty of servers, someone's gotta do it.
Re:Securing your Linux web server by peterwwillis on Tuesday February 20, 2018 @01:44PM (#16422767)
No, but yes.

You can make a very secure system by hosting it yourself. Do you need a very secure system? Or do you just need to know that you need a firewall, and to manage your credentials securely, and to segregate applications' security domains, and do filtering of inputs, and blocking of brute force attacks?

You probably just need to learn about security, and learning to host yourself is not the same thing.

Re:Securing your Linux web server by newbear on Friday February 23, 2018 @11:28AM (#16447311)
Ya you are right. My question is, is knowing basic security enough to feel secure in hosting yourself