# server-security-init-skill

server-security-init-skill — a Claude Code skill for securing fresh Ubuntu and Debian SSH servers. It guides key-based access setup, firewall rules, and staged SSH hardening.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 103 installs · ★ 13 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/security-skills/tree/HEAD/skills/server-security-init-skill/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/server-security-init-skill

## What it does

The skill walks through an initial security setup for a fresh Ubuntu or Debian server reached over SSH. It helps check for a local SSH key or create one, add the public key to the server, then create a sudo user without root access. Next, it configures UFW and fail2ban, changes the SSH port, and checks that the new port accepts connections. On Debian 12+, it checks `ssh.socket`, which can keep SSH on the previous port. Server checks use `ss -ltnp`, `sshd -T`, `systemctl`, and `ufw status`. Access checks come before disabling existing login methods: public-key login must work first, followed by SSH and sudo access for the new user. Keep the old SSH session open until the connection on the new port has been verified.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill server-security-init-skill -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/server-security-init-skill/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/server-security-init-skill/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill server-security-init-skill -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/server-security-init-skill/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill server-security-init-skill -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/server-security-init-skill/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/security-skills skills/server-security-init-skill
```

2. **Manually: put the files in place**
- File: `.github/skills/server-security-init-skill/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill server-security-init-skill -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/security-skills --path skills/server-security-init-skill
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/server-security-init-skill/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill server-security-init-skill -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/security-skills/tree/HEAD/skills/server-security-init-skill/SKILL.md

## When to use it
- set up SSH key access on a new server
- create a sudo account without root access
- configure inbound UFW rules
- move SSH to a new port and check its listener
- configure fail2ban to guard SSH against password guessing

## Example prompts
- Secure a fresh Ubuntu server that I can reach over SSH.
- Set up key-based login and remove root access on this Debian server.
- Configure UFW, fail2ban, and a new SSH port on the server.

## Similar
- [remote-system-maintenance](https://affpapa.org/en/nevibecode/plugins/remote-system-maintenance.md) — plugin · ★ 106 repo stars
- [phpcheck-server](https://affpapa.org/en/nevibecode/skills/phpcheck-server.md) — skill · ★ 1477 repo stars
- [holoscan-install-debian](https://affpapa.org/en/nevibecode/skills/holoscan-install-debian.md) — skill · 1800 installs
- [debian-linux-triage](https://affpapa.org/en/nevibecode/skills/debian-linux-triage.md) — skill · 9197 installs
- [debian-linux](https://affpapa.org/en/nevibecode/rules/debian-linux.md) — rule · ★ 41430 repo stars
- [workflows](https://affpapa.org/en/nevibecode/rules/workflows.md) — rule · ★ 1627 repo stars

From the same set: [reason-machines/security-skills](https://affpapa.org/en/nevibecode/by/reason-machines/security-skills.md) — 129 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
