This hardens SSH on your VPS by creating a non-root sudo user, setting up key-based authentication, and disabling password login and root access. You'd use it when spinning up a new server or fixing an existing one that's still using passwords and allowing root login. The documentation is thorough about the "keep a session open while testing" warnings, which matters because it's easy to lock yourself out if you disable password auth before confirming your SSH keys work. Covers Ubuntu, Debian, CentOS, and RHEL with step-by-step commands for the full workflow from ssh-keygen through sshd_config changes. The troubleshooting section assumes you've already made the mistake, which is realistic.

skills.sh installs
257
GitHub stars
7
last updated
Aug 21, 2026

Install

$ npx -y skills add mikr13/secure-server-setup-skills --skill ssh-hardening --agent claude-code

Installs into .claude/skills of the current project.

Files

SSH hardening

Establish working administrative access before restricting authentication. Keep the current session and provider console available until a fresh post-change login succeeds.

Inspect and establish access

  1. Identify the active daemon/service/socket, actual listener ports, administrative and automation identities, Include order, and relevant Match rules. Record sshd -T -C results for the actual users, client addresses, and hostnames.

  2. Use an existing non-root administrator. If account creation is needed, create it separately with the distribution's user/group conventions, install its public key, then prove key login and sudo in a separate session before any lockdown.

  3. Generate personal keys on the local client with a passphrase or hardware-backed key. scripts/generate-ssh-keys.sh provides preview/no-overwrite behavior; its --interactive mode is for a human terminal and --no-passphrase is an explicit service-key choice.

  4. Test the specific key without password fallback:

    ssh -o IdentitiesOnly=yes -o PreferredAuthentications=publickey -i ~/.ssh/server_admin administrator@server.example.com
    

Sponsors

Details

Repository
github.com/mikr13/secure-server-setup-skills
Categories
Backend & APIs, Security
First seen
Jun 3, 2026
1hirokazu-kobayashi-koba-hiro avatarcontrol-planehirokazu-kobayashi-koba-hiro/idp-server管理API(Control Plane)の開発・修正を行う際に使用。システムレベル・組織レベルAPI、リソース管理、権限モデル実装時に役立つ。0skills.sh installs
2firebase avatardeveloping-genkit-jsfirebase/agent-skillsDevelop AI-powered applications using Genkit in Node.js/TypeScript. Use when the user asks about Genkit, AI agents, flows, or tools in JavaScript/TypeScript, or62.5Kskills.sh installs
3planetscale avatarpostgresplanetscale/database-skillsPostgreSQL best practices, query optimization, connection troubleshooting, and performance improvement. Load when working with Postgres databases.8.6Kskills.sh installs
4better-auth avatarbetter-iconsbetter-auth/better-iconsUse when working with icons in any project. Provides CLI for searching 200+ icon libraries (Iconify) and retrieving SVGs. Commands: `better-icons search <query>6.4Kskills.sh installs
5figma avatarfigma-generate-libraryfigma/mcp-server-guideBuild or update a professional-grade design system in Figma from a codebase. Use when the user wants to create variables/tokens, build component libraries, crea4.7Kskills.sh installs
6supabase avatarvitestsupabase/supabaseVitest API and config reference (Jest-compatible) — mocking with vi.*, spies, fake timers, coverage configuration, fixtures, snapshots, and test filtering. Use 2.8Kskills.sh installs