Skip to Content
OpenVAPTAlpha
Pre-release. Academic, non-commercial, source-available code built by AI Cybersecurity Engineers. Free for your own use, 100% at your own risk. This website collects no data. Read MoreRead Less
Pre-release. OpenVAPT has no Stable release yet. Every build is an Alpha, Beta or Release Candidate: it may be incomplete or wrong, so use it only on test machines, 100% at your own risk. See Release Channels
Academic, non-commercial, source-available code built by AI Cybersecurity Engineers. These are AI systems, not people or registered engineers. Free for your own personal or business use, on your own machines, 100% at your own risk. Not for sale. Not for providing services. This website collects no data. Read the Acknowledgements
Pre-release. OpenVAPT has no Stable release yet. Every build is an Alpha, Beta or Release Candidate: it may be incomplete or wrong, so use it only on test machines, 100% at your own risk. See Release Channels
Academic, non-commercial, source-available code built by AI Cybersecurity Engineers. These are AI systems, not people or registered engineers. Free for your own personal or business use, on your own machines, 100% at your own risk. Not for sale. Not for providing services. This website collects no data. Read the Acknowledgements
P1PractitionerAbout 30 minutes

Linux Server Hardening

Patching, accounts, privileges, file permissions, scheduled jobs and kernel settings: the foundations of a defensible Linux server.

Read First: F1, F3

You Will Be Able To

  • Explain why unsupported releases and pending security updates are high risk.
  • Recognise dangerous account, sudo and permission configurations.
  • Explain what common kernel hardening parameters protect against.

Patching and Support Lifecycles

Most real-world compromises use vulnerabilities that already had a fix. A release past end of life receives no more fixes, so every new flaw stays open forever. Keeping a supported release and installing security updates promptly removes the largest class of risk on most servers.

Accounts and Privileges

Any account with user id 0 is root, whatever its name. Accounts with empty passwords can log in with nothing. Sudo rules marked NOPASSWD turn any takeover of that user into instant root. Each of these violates least privilege.

Permissions, SUID and Cron

World-writable files under /etc or in cron directories let any local user change what root runs. SUID programs run with their owner's rights; one placed in /tmp or a web folder is a classic privilege escalation trick. The sticky bit on /tmp stops users deleting each other's files.

Kernel Hardening and Logging

Kernel parameters such as address space layout randomisation, restricted kernel pointers and disabled ICMP redirects make exploitation harder. Persistent logs, an audit daemon and synchronised time are what let you investigate afterwards. Module P16 covers them in depth.

In Summary

Keep the release supported and patched. Watch for extra root accounts, NOPASSWD sudo rules and loose permissions. Kernel settings make exploitation harder. Logs and time sync let you investigate later.

Apply It

These OpenVAPT checks put this module into practice. Open one to see its detection logic and source code.

CheckTitleSeverity
HOST-FS-001Sensitive Account Files Have Unsafe PermissionsHigh
HOST-FS-002Temporary Directory Missing the Sticky BitHigh
HOST-FS-003World-Writable Files in System ConfigurationHigh
HOST-FS-004Unexpected SUID or SGID ProgramsHigh
HOST-FS-005Cron Files Writable by Non-Root UsersHigh
HOST-FS-006Boot Loader Configuration ExposedMedium
HOST-FS-007Private TLS Keys Readable by OthersHigh
HOST-FS-008Temporary Filesystems Allow Executables or DevicesLow
HOST-FS-009Default File Creation Mask Too PermissiveLow
HOST-FS-010/var/tmp Not a Separate FilesystemLow
HOST-FS-011/home Not a Separate Filesystem With nodevLow
HOST-FS-012Log Directories on the Root FilesystemLow
HOST-FS-013Temporary Filesystems Allow ExecutablesLow
HOST-FS-014World-Writable Files Outside Temporary DirectoriesMedium
HOST-FS-015Files With No Known Owner or GroupLow
HOST-FS-016SUID or SGID Programs Outside the Known BaselineMedium
HOST-FS-017World-Writable Directories Without the Sticky BitMedium
HOST-FS-018Kernel Symbol Map or Initial RAM Disk Readable by OthersLow
HOST-FS-019Cron and At Not Restricted to Allowed UsersLow
HOST-FS-020Cron Configuration Readable by Other UsersLow
HOST-FS-021Shell Profile Sets a Permissive File Creation MaskLow
HOST-FS-022Account Database Files or Their Backups Not Owned and Locked by RootHigh
HOST-KRN-001Address Space Layout Randomisation Not Fully EnabledMedium
HOST-KRN-002Kernel Pointers Exposed to Unprivileged UsersLow
HOST-KRN-003Kernel Log Readable by Unprivileged UsersLow
HOST-KRN-004Setuid Programs May Dump CoreLow
HOST-KRN-005IP Forwarding EnabledLow
HOST-KRN-006ICMP Redirects AcceptedLow
HOST-KRN-007Source-Routed Packets AcceptedLow
HOST-KRN-008TCP SYN Cookies DisabledLow
HOST-KRN-009Unprivileged eBPF AllowedMedium
HOST-KRN-010Process Tracing Not RestrictedLow
HOST-KRN-011Symlink Protection DisabledLow
HOST-KRN-012Hardlink Protection DisabledLow
HOST-KRN-013Reverse Path Filtering DisabledLow
HOST-KRN-014Martian Packets Not LoggedLow
HOST-KRN-015Server Sends ICMP RedirectsLow
HOST-KRN-016Broadcast ICMP Echo AnsweredLow
HOST-KRN-017IPv6 ICMP Redirects AcceptedLow
HOST-KRN-018Performance Events Open to Unprivileged UsersLow
HOST-KRN-019Magic SysRq Key EnabledLow
HOST-KRN-020FIFO Protection in Shared Directories DisabledLow
HOST-KRN-021Regular File Protection in Shared Directories DisabledLow
HOST-KRN-022Unprivileged User Namespaces AllowedLow
HOST-KRN-023IPv6 Source-Routed Packets AcceptedLow
HOST-KRN-024Secure ICMP Redirects AcceptedLow
HOST-KRN-025IPv6 Router Advertisements AcceptedLow
HOST-KRN-026Bogus ICMP Error Responses LoggedLow
HOST-KRN-027Kexec Kernel Replacement AllowedLow
HOST-KRN-028Unprivileged userfaultfd AllowedLow
HOST-KRN-029TTY Line Discipline Autoloading EnabledLow
HOST-KRN-030BPF JIT Hardening OffLow
HOST-KRN-031io_uring Open to Unprivileged UsersLow
HOST-MAC-001No Mandatory Access Control EnforcedLow
HOST-OS-001Operating System Past End of Security SupportHigh
HOST-PKG-001Security Updates Waiting to Be InstalledHigh
HOST-PKG-002Repository Signature Checks DisabledHigh
HOST-PKG-003Third-Party Package Repositories PresentInfo
HOST-PKG-004Many Old Kernels RetainedLow
HOST-PKG-005Running Kernel Older Than Installed KernelMedium
HOST-PKG-006Package Lists Not Refreshed AutomaticallyLow
HOST-SVC-001Unnecessary Legacy Services RunningLow
HOST-SVC-002Telnet Server Installed or EnabledMedium
HOST-SVC-003rsh, rlogin, rexec or finger Server Installed or EnabledMedium
HOST-SVC-004TFTP Server Installed or EnabledMedium
HOST-SVC-005FTP Server Installed or EnabledMedium
HOST-SVC-006NIS Server or Client Installed or EnabledMedium
HOST-SVC-007Avahi or CUPS Installed or EnabledLow
HOST-SVC-008NFS Server or rpcbind Installed or EnabledLow
HOST-SVC-009DHCP or DNS Server Installed or EnabledLow
HOST-SVC-010Samba File Server Installed or EnabledLow
HOST-SVC-011SNMP Agent or Squid Proxy Installed or EnabledLow
HOST-SVC-012inetd Super-Server Installed or EnabledLow
HOST-UPD-001Automatic Security Updates Not ConfiguredLow
HOST-UPD-002Reboot Required to Apply UpdatesMedium

Printable Worksheet · Teacher Answer Key · For Teachers · Print this page with your browser's Print command for a handout.

Also available as plain Markdown for notes, scripts and AI tools. Same facts, same source, no styling.

Lab

  1. Run: openvapt demo --only HOST- --out p1
  2. For each failed HOST check, find the line in internal/lab/lab.go that differs between the vulnerable and hardened server.
  3. On a test machine you own: sudo openvapt scan --only HOST- and compare.

Check Yourself

Answers are checked in your browser and never stored or sent.

Question 1

1. Why is an operating system past end of life high risk?

Question 2

2. An account named backup has UID 0. What does that mean?

Question 3

3. What does kernel.randomize_va_space = 2 provide?

Question 4

4. Why is a sudo rule marked NOPASSWD risky?

Question 5

5. What does the sticky bit on /tmp do?

Question 6

6. Why is a SUID program in a web folder a warning sign?

References

Cite This Page

If this page helped your work, please cite it. The version and web address are filled in; the access date is today's date in your browser. Every other style, and when credit is required, is on How to Cite OpenVAPT.

APA 7
OpenVAPT. (2026). P1: Linux Server Hardening (Version 0.1.0-alpha.6). OpenVAPT Academy. Retrieved October 16, 2026, from https://openvapt.com/academy/p1.html

In text: (OpenVAPT, 2026). Accessed: the date shown is today's date from your own browser (the site's build date without JavaScript); change it to the day you read the page.

BibTeX
@misc{openvapt_p1,
  author       = {{OpenVAPT}},
  title        = {{P1: Linux Server Hardening}},
  year         = {2026},
  howpublished = {\url{https://openvapt.com/academy/p1.html}},
  note         = {OpenVAPT Academy, version 0.1.0-alpha.6. Accessed 16 October 2026}
}

Accessed: the date shown is today's date from your own browser (the site's build date without JavaScript); change it to the day you read the page.

Citing OpenVAPT does not mean OpenVAPT endorses, approves or has reviewed your work.