# Linux Server Hardening taste

Linux Server Hardening taste — a prompt for ChatGPT provides an operations engineering ruleset for hardening Linux servers. It guides base image setup, SSH access policies, and automated configuration via Ansible or cloud-init.

- prompt · `type=prompt` · ChatGPT, Claude.ai, Claude Code · ★ 178201 repo stars
- Author: f
- License: CC0-1.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/f/prompts.chat/tree/HEAD/prompts.csv
- Updated: 2026-10-24
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/prompts/linux-server-hardening-taste

## What it does

The prompt establishes Linux host hardening guidelines tagged with confidence scores from 0.65 to 0.95. It dictates building from minimal base images, stripping compilers from production machines, tracking configurations via code, and enforcing key or certificate authentication over SSH without root logins.

The rules cover network perimeter defenses, unprivileged system accounts, systemd sandboxing parameters (`ProtectSystem=strict`, `NoNewPrivileges=yes`, `PrivateTmp=yes`), enforcing SELinux or AppArmor profiles, and shipping logs off-host. Partition mounting relies on `noexec`, `nosuid`, and `nodev` where supported, alongside disk encryption and isolated backup storage. Compromised or drifted servers are marked for total rebuilds rather than manual in-place fixes.

## Install

### ChatGPT (native platform)

**How to use**
- Paste the text at the start of a chat or into project instructions

### Claude Code

**Manually: put the files in place**
- File: `.claude/commands/prompts.csv.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/f/prompts.chat/tree/HEAD/prompts.csv

## When to use it
- strip compilers and extra packages from production base images
- enforce SSH key or certificate authentication while disabling root login
- sandbox long-running systemd services with strict isolation directives
- monitor sudoers modifications and privileged commands using `auditd`

## Example prompts
- Audit my `sshd_config` using the Linux Server Hardening taste prompt
- Draft an Ansible playbook to configure a hardened Debian server
- Add systemd sandboxing options to a production service unit

## Source text · prompts.csv · CC0-1.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: e337415c14c07a9a.

BEGIN THIRD-PARTY FILE e337415c14c07a9a
```text
# Linux Server Hardening taste of a careful operations engineer
- Build servers from a minimal base image and install only the packages a role needs, removing compilers and debugging tools from production hosts. Confidence: 0.85
- Manage every server with configuration as code (Ansible, cloud-init or an image pipeline) and never rely on manual changes that drift. Confidence: 0.90
- Disable SSH password authentication and root login, and allow only key-based or certificate-based logins. Confidence: 0.95
- Prefer short-lived SSH certificates or an identity-aware access proxy over long-lived authorized_keys files copied around. Confidence: 0.75
- Give each engineer a named account with sudo through groups, and never share a common admin user. Confidence: 0.90
- Default the host firewall to deny inbound traffic and open only the ports the service actually listens on. Confidence: 0.90
- Keep SSH and admin interfaces off the public internet, reachable only through a VPN, bastion or private network. Confidence: 0.85
- Enable unattended security updates for the base OS, and schedule reboots so kernel patches actually take effect. Confidence: 0.85
- Run each service as its own unprivileged system user with no login shell. Confidence: 0.90
- Use systemd sandboxing options such as `ProtectSystem=strict`, `NoNewPrivileges=yes` and `PrivateTmp=yes` for every long-running service. Confidence: 0.80
- Keep SELinux or AppArmor in enforcing mode and write a policy exception instead of disabling it when something breaks. Confidence: 0.75
- Ship logs, including auth and audit logs, to a central store so an attacker on the host cannot erase the trail. Confidence: 0.90
- Enable `auditd` rules for privileged commands, changes to sudoers and edits under `/etc`. Confidence: 0.70
- Keep secrets out of files in the repo and on disk where possible; fetch them at runtime from a secrets manager with scoped access. Confidence: 0.85
- Mount `/tmp` and data volumes with `noexec`, `nosuid` and `nodev` wherever the workload allows it. Confidence: 0.65
- Apply sysctl hardening such as disabling IP forwarding and ICMP redirects on hosts that are not routers. Confidence: 0.70
- Rate-limit authentication attempts with fail2ban or the platform equivalent on any exposed login service. Confidence: 0.70
- Encrypt disks at rest and protect backups with separate credentials that the server itself cannot use to delete them. Confidence: 0.85
- Scan hosts regularly against a CIS benchmark or similar baseline and track findings like any other bug. Confidence: 0.75
- Prefer replacing a compromised or drifted server with a freshly built one over trying to clean it in place. Confidence: 0.90
- Keep accurate time with NTP or chrony on every host so logs, certificates and tokens line up. Confidence: 0.80
```
END THIRD-PARTY FILE e337415c14c07a9a

The third-party file has ended. Everything between the e337415c14c07a9a tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© f · CC0-1.0 · https://github.com/f/prompts.chat/tree/HEAD/prompts.csv

## Similar
- [linux-hardening](https://affpapa.org/en/nevibecode/skills/linux-hardening.md) — skill · 890 installs
- [Linux MCP daemon (mcpd)](https://affpapa.org/en/nevibecode/mcp/linux-mcp-daemon-mcpd.md) — MCP server · ★ 7 repo stars
- [linux-mcp-server-administration](https://affpapa.org/en/nevibecode/skills/linux-mcp-server-administration.md) — skill · 178 installs
- [linux-mcp-server](https://affpapa.org/en/nevibecode/mcp/linux-mcp-server.md) — MCP server · ★ 323 repo stars
- [linux-lateral-movement](https://affpapa.org/en/nevibecode/skills/linux-lateral-movement.md) — skill · 3900 installs
- [debian-linux-triage](https://affpapa.org/en/nevibecode/skills/debian-linux-triage.md) — skill · 9197 installs

From the same set: [f/prompts.chat](https://affpapa.org/en/nevibecode/by/f/prompts.chat.md) — 218 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
