Linux Hardening
Practical Linux server hardening covering SSH, users, firewall, kernel, file permissions, and auditing per CIS practice.
- CCM score
- 65 of 100
- skills.sh installs
- 957
- GitHub stars
- 1.2K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers SSH lockdown, password policy, firewall rules, kernel sysctl settings, file permissions, and auditd rules
- Includes ready-to-apply config snippets for
/etc/ssh/sshd_config,/etc/security/pwquality.conf,/etc/sysctl.d/99-security.conf, and/etc/audit/rules.d/audit.rules - Provides both UFW and iptables firewall examples, with a default-deny inbound policy and SSH allowed
- Designed for hardening production servers and meeting security compliance or baseline requirements
Install
$ npx -y skills add bagelhole/devops-security-agent-skills --skill linux-hardening -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Linux Hardening
Secure Linux servers following CIS benchmarks and security best practices.
When to Use This Skill
Use this skill when:
- Hardening production servers
- Meeting compliance requirements
- Implementing security baselines
- Configuring secure SSH access
SSH Hardening
# /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
ClientAliveInterval 300
ClientAliveCountMax 2
AllowUsers deploy admin
Protocol 2
User Security
# Password policy
sudo apt install libpam-pwquality
# /etc/security/pwquality.conf
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
# Lock inactive accounts
useradd -D -f 30
# Audit sudo usage
echo "Defaults logfile=/var/log/sudo.log" >> /etc/sudoers
Firewall Configuration
# UFW setup
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow 443/tcp
ufw enable
# Or iptables
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
Kernel Hardening
Details
- Repository
- github.com/bagelhole/devops-security-agent-skills
- Categories
- Security, DevOps & Cloud
- First seen
- Jun 3, 2026
Questions
What does the linux-hardening skill do?
The linux-hardening skill applies CIS benchmarks to secure Linux servers. It covers SSH configuration, user management, firewall rules and security features such as kernel hardening and audit rules.
When should I use the linux-hardening skill?
Use the linux-hardening skill when hardening Linux systems for production or meeting security compliance requirements. The SKILL.md also lists hardening production servers, meeting compliance requirements and configuring secure SSH access as use cases.
How do I install the linux-hardening skill?
Run npx -y skills add bagelhole/devops-security-agent-skills --skill linux-hardening -y in your project. After that, the linux-hardening skill gives your agent the SSH, firewall, kernel and audit hardening steps from its SKILL.md.
Where does linux-hardening stand in the Security category?
The linux-hardening skill is listed in the Security category alongside azure-compliance, entra-agent-id, firebase-security-rules-auditor, security-audit and cloudflare-one. Its SKILL.md links to the cis-benchmarks and firewall-config skills as related work.
More from bagelhole/devops-security-agent-skills
All 2Similar to Linux Hardening
More Securitylinux-administrationSkillbagelhole/devops-security-agent-skills922 installsPractical Linux server administration reference covering packages, filesystems, processes, cron, logs, and networking on Debian/Ubuntu and RHEL/CentOS.
security-hardeningSkillancoleman/ai-design-components181 installsLayered hardening guide covering OS, container, cloud, network, and database controls with CIS Benchmark and zero-trust guidance.
redis-securitySkillredis/agent-skills2.9K installsProduction hardening guide for Redis covering authentication, TLS, ACL least-privilege, and network lockdown.
KastellMCP serverkastelldev59 starsSecurity audit, hardening, and fleet management across four cloud providers for Linux servers over SSH.
docker-security-guideSkilljosiahsiegel/claude-plugin-marketplace662 installsComprehensive Docker security guide covering image hardening, scanning, secrets, networking, and CIS compliance.
linux-server-expertSkillduck4nh/antigravity-kit624 installsStep-by-step guide for administering an Ubuntu or Debian server, covering setup, firewall, web serving, SSL, and services.