/linux:linux-access-controlfrom linux
Creates, revokes, or audits Linux users, groups, SSH keys, sudo/wheel access, PAM settings, SELinux user mappings, and file permissions. Covers Debian/Ubuntu and RHEL families with distro-specific commands.
Ships in linux. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Two-family skill. useradd/usermod/passwd, SSH keys, and /etc/sudoers.d/
work the same on both. The notable differences are the admin group and a
couple of RHEL-only auth/SELinux layers. Body uses Debian/Ubuntu; substitute
per this matrix.
| Concept | Debian/Ubuntu | RHEL family |
|---|---|---|
| Sudo admin group | sudo | wheel |
| Grant admin | usermod -aG sudo <u> | usermod -aG wheel <u> |
| User/group tools | useradd, usermod, passwd | identical |
| Sudoers drop-ins | /etc/sudoers.d/ | same |
| PAM config | /etc/pam.d/ | /etc/pam.d/ (managed via authselect on RHEL) |
| Password quality | libpam-pwquality | pam_pwquality (in pwquality.conf) |
| SELinux user mapping | n/a | semanage login maps Linux users → SELinux users |
RHEL-family note: the admin group is wheel, not sudo. RHEL manages the
PAM/nsswitch stack through authselect (don't hand-edit what it owns), and
SELinux can confine users (semanage login, semanage user). See
../../07-security-and-hardening/linux-server-hardening/references/selinux-reference.md
and docs/multi-distro/plan.md.
linux-firewall-ssl.linux-security-analysis or linux-server-hardening.| Artefact | Source | Required? | If absent |
|---|---|---|---|
| Target identities, groups, paths, keys, and requested privileges | Access request or system owner | required | Stay read-only and return the missing identity/scope. |
| Current account, group, sudoers, SSH, PAM, and file state | Target host | required | Do not mutate; provide inspection commands only. |
| Approval, expiry, owner, and recovery access | Authorised approver | required for mutation | Stop before granting or revoking access. |
chmod or chown without scoping the target. Fix: inspect boundaries and change only the named tree or files./etc/sudoers without validation. Fix: use a drop-in and validate with visudo before ending the recovery session.| Artefact | Consumer | Acceptance condition |
|---|---|---|
| Access decision/change record | System owner | Names identity, privilege, approver, expiry, files changed, and rationale. |
| Final-state verification | Operator | Login, group/sudo membership, key fingerprints, and affected permissions match the request. |
| Recovery note | On-call administrator | Preserves a tested alternate administrator and reversal steps. |
references/users-sudoers-pam.mdreferences/permissions-reference.md../../07-security-and-hardening/linux-server-hardening/references/selinux-reference.md — SELinux user confinement (RHEL family)| Artefact | Acceptance condition |
|---|---|
| Access-control evidence | Shows before/after identity state, key fingerprints, sudoers validation, affected modes, tested login/privilege behaviour, and approval. |
Audit requests default to read-only. Read access to account and permission state is required; editing users, groups, keys, PAM, sudoers, SELinux mappings, or files requires explicit authority. Never expose private keys or revoke the last tested administrator.
Without privileged access, report observable state and exact root-level checks as not assessed. Without a safe second login or console, stop before lockout-capable changes.
| Choice | Action | Failure or risk avoided |
|---|---|---|
| Temporary privileged task | Use narrow sudo command rules with expiry | Permanent broad administration. |
| Suspected compromised key | Disable that key, preserve evidence, rotate dependants | Continued unauthorised access. |
| Account departure | Disable, inventory ownership/jobs, transfer, then remove | Orphaned data and services. |
To offboard a deployment user, record current groups, keys, processes, cron jobs, and owned files; disable login; verify the replacement automation identity; transfer required ownership; remove authorised keys; then confirm the account cannot authenticate while the service still deploys.
This skill is self-contained. Every command below is a standard tool on
both families (Debian/Ubuntu and RHEL); substitute the admin group and
RHEL-only auth/SELinux layers per the Distro support matrix above. The
sk-* scripts in the Optional fast path section are convenience
wrappers — never required.
sudo adduser <username> # create (interactive)
sudo usermod -aG sudo <username> # grant sudo
sudo deluser <username> # remove user (keeps home)
sudo deluser --remove-home <username> # remove user + home
sudo passwd -l <username> # lock account
sudo passwd -u <username> # unlock account
# Audit
grep -v "nologin\|false" /etc/passwd | cut -d: -f1,3
grep ^sudo /etc/group # who has sudo
awk -F: '$3 == 0 {print $1}' /etc/passwd # UID-0 accounts
# Add a key for a user
mkdir -p /home/<username>/.ssh
chmod 700 /home/<username>/.ssh
echo "<public-key>" >> /home/<username>/.ssh/authorized_keys
chmod 600 /home/<username>/.ssh/authorized_keys
chown -R <username>:<username> /home/<username>/.ssh
# Audit all keys on the server
find /home /root -name authorized_keys 2>/dev/null | \
while read f; do echo "=== $f ==="; cat "$f"; done
# Revoke: edit the file, delete the key line
sudo nano /home/<username>/.ssh/authorized_keys
# Test before restarting SSH (keep existing session open!)
sudo sshd -t && sudo systemctl restart sshd
# Web root standard
sudo find /var/www -type d -exec chmod 755 {} \;
sudo find /var/www -type f -exec chmod 644 {} \;
sudo chown -R www-data:www-data /var/www/html/
sudo find /var/www -type f -perm -0002 -exec chmod o-w {} \; # remove world-write
# Critical system files
sudo chmod 640 /etc/shadow /etc/gshadow
sudo chmod 644 /etc/passwd /etc/group
# Backup credentials (must be 600)
chmod 600 ~/.mysql-backup.cnf ~/.backup-encryption-key
chmod 600 ~/.config/rclone/rclone.conf
chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys
Full permission patterns and audit commands: references/permissions-reference.md
No wrapper commands for this skill are shipped in this checkout. Use the native procedures above; planned wrappers remain in the script inventory until their source files are present.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
linux-users, sudo-access, ssh-keys, file-permissions, selinux, pam
npx claudepluginhub peterbamuhigire/linux-skills --plugin linux45 skills in this plugin
/cisco-ios-patternsUse when reading or reviewing Cisco IOS/IOS-XE configuration, selecting read-only show commands, or planning and verifying bounded router or switch configuration work. Not for Linux host networking, bulk SSH automation, or config preflight parsing; route those to linux-network-admin, netmiko-ssh-automation, or network-config-validation./linux-archive-integrityUse when creating, signing, encrypting, listing, comparing, or restoring metadata-preserving tar archives on Debian/Ubuntu or RHEL-family hosts. Covers ACLs, xattrs, incrementals, and verification; use linux-rsync-sync for file-tree mirrors./linux-auditd-rulesUse when inspecting, designing, testing, persisting, or querying auditd rules for forensic attribution on Debian/Ubuntu or RHEL-family hosts. Covers watches, syscalls, loss, and immutable mode; use linux-file-integrity for drift and linux-benchmark-scanning for scoring./linux-bash-scriptingUse when writing or reviewing portable sk-* Bash scripts for this engine, including common.sh primitives, flags, preview mode, and safety gates; use linux-repo-sync for Git-update behaviour and not for one-off commands./linux-benchmark-scanningUse when running read-only OpenSCAP or Lynis scans, selecting distro-matched profiles, interpreting failures, or drafting remediation on Debian/Ubuntu or RHEL-family hosts. Use linux-auditd-rules for attribution and linux-file-integrity for AIDE drift./linux-cloud-initUse when authoring, validating, or debugging cloud-init user-data, Ubuntu autoinstall, or RHEL-family Kickstart for first-boot provisioning. Use linux-server-provisioning for interactive post-boot setup and linux-config-management for ongoing desired state.Other plugins' skills for the same job