- Home
- Skills
- DevOps & Cloud
- server hardening
server hardening
Production-ready Linux security hardening for SSH, auditing, updates, and kernel networking.
Free
server hardening
Example session with this skill installed
Generate a production-ready SSH hardening configuration and an auditd ruleset to track root command execution.
- Read your context and instructions
- Compiled the server hardening
I have generated the hardening configurations for SSH and system auditing. These follow the principle of least privilege and CIS best practices.
Production Server Hardening Configs
1. SSH Hardening (/etc/ssh/sshd_config.d/99-hardening.conf)
PermitRootLogin no
PasswordAuthentication no
ChallengeResponseAuthentication no
AllowAgentForwarding no
MaxAuthTries 3
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com
LogLevel VERBOSE
2. Auditd Rules (/etc/audit/rules.d/99-security.rules)
| Rule Type | Configuration | Description |
|---|---|---|
| Cleanup | -D | Flush existing rules |
| Buffer | -b 8192 | Increase buffer for high-log volume |
| Identity | -w /etc/shadow -p wa -k identity | Track changes to user credentials |
| PrivEsc | -a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -k root_cmds | Log all commands run as root by users |
| Immutability | -e 2 | Lock configuration until next reboot |
Next steps
- Run
sshd -tto validate the SSH configuration before restarting the service. - Execute
augenrules --loadto apply the new audit policies. - Verify audit logging with
ausearch -k root_cmds.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Standard Linux server installations often ship with insecure defaults that leave systems vulnerable to automated brute-force attacks, rootkits, and lateral movement. Manually applying CIS Benchmarks across multiple configurations is error-prone and time-consuming.
What it does
- Configures automatic security updates with unattended-upgrades and needrestart for hands-off patching.
- Hardens SSH access by enforcing key-only auth, restricting users, and disabling weak cryptographic algorithms.
- Deploys auditd rulesets to track privilege escalation, file system changes, and suspicious system calls.
- Sets up PAM login policies including account lockout thresholds and strict password complexity requirements.
- Applies kernel-level network hardening via sysctl to mitigate spoofing and SYN flood attacks.
Frameworks & tools
Linux (Debian, Ubuntu, RHEL, CentOS), AppArmor, SELinux, auditd, PAM, rkhunter, and OpenSSH.
Why this beats prompting it yourself
Generic prompts often miss critical low-level details like PAM stack ordering or specific sysctl anti-spoofing flags. This skill provides production-ready configuration blocks and a 20-point checklist to ensure no hardening vector is overlooked.
Use cases
- Securing a fresh VPS or bare-metal server before deploying production workloads.
- Establishing an audit trail for compliance requirements like PCI-DSS or SOC2.
- Implementing Mandatory Access Control (MAC) profiles for high-risk web applications.
- Automating routine security maintenance like rootkit scanning and package patching.
Known limitations
Does not manage application-layer WAF rules, external network firewalls, or container-specific security profiles like Docker seccomp.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
4 uses
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 2 months ago
- Free with an Agensi account
Permissions
What's inside
Frequently Asked Questions
New in DevOps & Cloud
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.