A sudo-like command for macOS. You approve each call in your SSH agent.
Put sus in front of a command and it runs as root, once you approve that one call in your
SSH agent. No password, no Admin dialog, no 5-minute timer. Yes, the name is a bit sus.
That's the point: a root tool should be boring and easy to check.
$ sus id -u
0Status: v0.1. macOS only, tested with the Bitwarden desktop SSH agent. No external security audit yet. Release binaries are not notarized by Apple.
mise use github:aNNdii/sus # release archive, both binaries
cargo install --path . # or from a checkout (Rust 1.100)Downloaded the archive with a browser?
Gatekeeper stops binaries that are not notarized. Clear the flag with
xattr -d com.apple.quarantine sus susd, or install with mise or cargo.
-
Create an
ssh-ed25519key only forsusin Bitwarden and set it to "Ask for authorization: Always". -
Save its public key, e.g. as
~/.ssh/laptop-sudo-sign-2026.pub. -
Install the service and allow your user to use that key:
sudo $(mise which susd) install --key ~/.ssh/laptop-sudo-sign-2026.pub sus id -u # Bitwarden asks, you approve, prints 0
Install options, the config file and other agents: docs/configuration.md.
sus launchctl list
echo hi | sus cat
sus sh -c 'exit 3'; echo $? # 3- The exit code is the command's. A command killed by signal N gives 128+N.
- Ctrl-C reaches the command. Ctrl-Z and
fgwork (see Limits). - No fallback: if the service, the agent or the key is missing, or you decline,
susprints one line and exits 1. It never opens an Admin dialog. - Every call through the service is logged:
log show --last 1h --predicate 'subsystem == "io.github.anndii.sus"'
susconnects tosusd, a root service started by launchd.susdchecks who you are and sends a fresh nonce and the keys it trusts for you.susasks your SSH agent to sign this exact call: nonce, your uid, the working directory and every argument. You approve in the agent.susdverifies the signature, then runs the command as root on your terminal.
The private key never leaves the agent. Every call needs a new signature. Details: docs/architecture.md.
- The agent decides if a person approves.
susdonly sees a valid signature. Set Bitwarden to "Ask for authorization: Always"; with OpenSSH'sssh-agent, add the key withssh-add -c. Otherwisesusis passwordless sudo. - Use a key only for
sus. Not for logins, not for git signing, never forwarded withssh -A. - The dialog does not show the command. Bitwarden shows "sign request", not
rm -rf /. If a prompt appears and you did not just runsus, deny it. - Malware running as you can ask too, as it can with sudo.
susprotects root from other users, not from your own account. - A signature fits one call only. Replays and signatures for other calls, keys or tools are refused.
- The environment is reset as in sudo, and the config is checked on every call. Every request is logged; an approved one with the fingerprint of the key that signed it.
Threat model and details: docs/security.md. Found a vulnerability? See SECURITY.md.
- No options. Everything after
susis the command, sosus -u bob idasks for a signature and then fails with-u: command not found. PATHissecure_pathandHOMEis/var/root. Tools in~/.local/binor mise shims need their full path. macOS's sudo keeps yourHOMEandPATH.- The command runs in launchd's system context: soft open-files limit 256, and no access to TCC-protected folders without Full Disk Access.
- A script without a
#!line fails. sudo runs it with/bin/sh. - A command killed by a signal gives 128+N. sudo re-raises the signal.
The full comparison with sudo, sudo-rs and passkeys (WebAuthn, CTAP), which sus was
reviewed against: docs/comparison.md.
- macOS only. Root is the only target user; there are no per-command rules.
- No pseudo-terminal, so the command has no
/dev/tty. - After Ctrl-Z, type
fgbefore anything else. A command that was waiting for input still gets the next line you type. A pty will fix this after v0.1.0. - Nothing proves a person approved a call. Hardware-bound keys (security keys, Secure Enclave) are planned after v0.1.0.
- sudo with Touch ID (
pam_tidin/etc/pam.d/sudo_local): built in. Use it if one approval per 5 minutes is fine and you sit at the Mac. - pam_ssh_agent_auth: a PAM module that lets sudo accept an agent signature. You keep sudo, its options and its timestamp cache.
- sudo-rs: a memory-safe sudo for Linux and FreeBSD.
NOPASSWDin sudoers: no approval at all.
- "Operation not permitted" in
~/Documents,~/Desktop,~/Downloadsor on a USB drive: that is TCC. Add/usr/local/libexec/sus/susdto System Settings → Privacy & Security → Full Disk Access. command not foundfor a tool you have:sususessecure_path. Give the full path, e.g.sus "$(command -v mytool)".service config invalid: see docs/configuration.md.
sudo $(mise which susd) uninstallRemoves the service, its binary, the config and the socket. Safe to run twice.
Issues and pull requests are welcome. Build, test and release: CONTRIBUTING.md.
MIT, see LICENSE. The crab is inspired by Ferris (public domain, rustacean.net).