/ubuntu-security:ssh-keysfrom ubuntu-security
Manage the user's SSH key pairs on Ubuntu — inventory ~/.ssh keys with type, size, fingerprint and comment, which are loaded in the agent and referenced in ~/.ssh/config, flag weak or orphaned keys, generate new ed25519 (or FIDO2 hardware-backed ed25519-sk) keys, copy a public key to other machines with ssh-copy-id, review authorized_keys on this host, fix permissions, and delete keys the user retires. Use when the user says "list my ssh keys", "generate a new ssh key", "set up key auth to <host>", "copy my key to these machines", "who can log in with a key here", "delete old ssh keys", or "fix ssh key permissions".
Ships in ubuntu-security. 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.
None: SKILL.md is the whole skill.
Client-side keys (~/.ssh/id_*) and this host's authorized_keys. The SSH server
configuration is ssh-server-config.
ls -la ~/.ssh/
for k in ~/.ssh/*.pub; do ssh-keygen -l -f "$k"; done # bits, fingerprint, comment, type
ssh-add -l 2>/dev/null || echo "agent: no keys / not running"
grep -iE '^\s*(Host|IdentityFile)\s' ~/.ssh/config 2>/dev/null # which key each host uses
Table: file, type, bits, fingerprint, comment, loaded in agent, referenced by
(config hosts). Private keys without a .pub twin: regenerate the public half with
ssh-keygen -y -f <key> > <key>.pub. Check passphrase presence with
ssh-keygen -y -P '' -f <key> >/dev/null 2>&1 && echo "NO passphrase".
Weak / legacy: DSA (disabled by OpenSSH since 7.0, removed in 10.0), RSA < 2048
bits (OpenSSH 9.x refuses < 1024; 2048 is the floor), ECDSA is acceptable;
ED25519 is the default to recommend for new keys.
ssh-keygen -t ed25519 -C "<user>@<host> $(date +%F)" -f ~/.ssh/id_ed25519_<purpose>
# hardware-backed (YubiKey / FIDO2 token; needs libfido2, preinstalled on Ubuntu):
ssh-keygen -t ed25519-sk -O resident -O verify-required -C "<label>" -f ~/.ssh/id_ed25519_sk
Ask whether to set a passphrase (recommended for laptops; the desktop keyring /
ssh-agent unlocks it once per session). Don't overwrite an existing file: -f a new
name.
For each target the user lists (SSH alias or IP), one at a time; the user types the remote password when prompted:
ssh-copy-id -i ~/.ssh/id_ed25519.pub <user>@<host>
ssh -o PasswordAuthentication=no -o BatchMode=yes <user>@<host> true && echo "key auth OK"
If the remote has password auth disabled already, ssh-copy-id can't log in; the key
has to be added via an existing session or console. Optionally add a Host block to
~/.ssh/config with IdentityFile and IdentitiesOnly yes.
for h in /root /home/*; do f="$h/.ssh/authorized_keys"; [ -f "$f" ] && { echo "== $f"; sudo ssh-keygen -l -f "$f"; }; done
sudo sshd -T 2>/dev/null | grep -i authorizedkeysfile
List each key's fingerprint and comment. Removing one: edit the file and delete the
line (back it up first: cp authorized_keys authorized_keys.bak). On a remote box,
never remove the key the current session used: find it with
journalctl -u ssh | grep "Accepted publickey" | tail -1 (shows the fingerprint).
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_* ~/.ssh/config ~/.ssh/authorized_keys 2>/dev/null
chmod 644 ~/.ssh/*.pub
sshd silently ignores authorized_keys when the home dir, ~/.ssh, or the file is
group/world-writable (StrictModes yes), which shows up as "key auth doesn't work".
Confirm per key. Remove it from the agent, the config, and disk; remind the user to
remove the public key from places it was authorized (other hosts' authorized_keys,
GitHub/GitLab, cloud consoles) — list the ones you can see from ~/.ssh/config.
ssh-add -d ~/.ssh/<old>
rm ~/.ssh/<old> ~/.ssh/<old>.pub
What SKILL.md sets; muted values are Claude Code's defaults
ubuntu-security@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin ubuntu-security18 skills in this plugin
/av-installInstall and initialise malware and rootkit scanning on Ubuntu — the core set (ClamAV engine + clamd daemon + freshclam updater, ClamTk GUI on desktops, rkhunter) and, on request, the advanced layer (Lynis hardening audit, chkrootkit, AIDE file-integrity baseline, debsecan). Detects what is already installed, picks a reports folder, runs the first definitions update and baselines. Use when the user says "install antivirus", "set up clamav", "install rkhunter / lynis / aide / chkrootkit", "set up malware scanning", or when malware-scan finds no scanners installed./av-update-definitionsRefresh signature databases and data for every installed scanner on Ubuntu — freshclam (ClamAV), rkhunter --update, Lynis version check, debsecan CVE list — and report one status line per tool, without re-baselining rkhunter or AIDE. Also explains stale ClamAV signatures (freshclam service down, mirror rate-limiting). Use when the user says "update antivirus definitions", "refresh signatures", "update clamav", "is clamav up to date", or before a scan when signatures are old./complementary-pluginsList and install plugins that complement ubuntu-security: hardware-auth-keys, security-auditor, ubuntu-admin. Use on "related plugins".Other plugins' skills for the same job