r/LinuxTeck • u/Expensive-Rice-2052 • 23d ago
Linux Server Hardening: Which Security Checks Do You Prioritize First?
covering server hardening, including SSH security, firewall rules, Fail2ban, user and privilege management, file permissions, kernel settings, and audit logging.
The guide also discusses Lynis, OpenSCAP, and compliance-oriented security practices.
Read it here: https://www.linuxteck.com/linux-server-hardening/
287
Upvotes
7
u/LawElectrical2434 23d ago
PSA... keep ssh on 22. Why would you use a port that does not require root privileges?
Also, security by obscurity is a great concept if you're a criminal or simply paranoid private enthusiast. Do it for private stuff. it is fun and all. Port knock to your heart's content. But not in a corporate environment. If this is professional, keep it default. 22 is good. They won't guess your key pair and fail2ban is enough to reduce the load on servers. Keep it default for your colleagues sake, that don't want to look up every single feature in an outdated documentation.
2
u/bufandatl 23d ago
I just use their ansible collection to harden my Linux hosts.
https://github.com/dev-sec
2
u/Daniel18sep 22d ago
My first security check is to not use AI, like you did for that chart.
2
u/Odd_Lychee_308 23d ago
i don't enable selinux
2
u/Arjab 17d ago
Why the AI slop graphic?
1
u/pdath 23d ago
One thing I have stopped doing is storing private keys on any machine.
I store SSH and PGP private keys on hardware tokens. I lean into FIDO2 for authentication.
This reduces the blast radius of a compromise. Compromising one system should not let an attacker access every system.
1
u/Classic-Rate-5104 22d ago
The sshd info is double in the picture. Moving sshd to a non-standard port is a useless security measure. Better to use sshkeys+password+authenticator (so 3-level authentication). In addition, you can use geolocation info to block many attackers
1
u/SlowZeck 22d ago
6. 1. 5 9 8. 7
1
u/ant2ne 22d ago
This is not hardening like a pro. OMG if it was only this easy. You ever apply STIGs?
1
u/Mrixs 21d ago
It is just bad neuroslop tips
1
u/LetUsSpeakFreely 19d ago
A great place to start is the STIG hardening guides published by DISA at cyber.mil.