sudo-rs implements sudo and su in Rust for FreeBSD and Linux, aiming to replace common privilege-elevation workflows with a smaller, safety-oriented feature set.
Overview
sudo-rs provides sudo, sudoedit, visudo, and su-style commands for elevating privileges or switching users. It is actively maintained but does not yet mirror every legacy sudo capability; unsupported options or sudoers flags surface as clear errors in most cases.
Distributions package it under names like sudo-rs or su-rs to avoid clashing with Todd Miller's sudo, and several Linux flavors enable it by default or offer it in their repositories. You can also install project-provided x86-64 Linux tarballs under /usr/local so the usual command names take precedence in PATH. PAM configuration and a valid sudoers file are required for a working setup.
Authentication always goes through PAM using the sudo and sudo-i service names, so resource limits and umasks belong in PAM rather than sudoers. The sudoers file must be UTF-8. Wildcard semantics for command arguments differ from classic sudo in ways documented to reduce risky patterns. Optional build features cover pam-login naming, AppArmor profile selection, and translated messages.
Key features
- Rust implementation of sudo and su
- PAM-based authentication
- Distribution packages on major Linux BSD
- Prebuilt x86-64 Linux tarball installs
- sudoers syntax for common distro defaults
- Optional AppArmor profile support
- Optional translated user messages
- Documented gaps versus classic sudo
Use cases
- Replacing distro sudo with sudo-rs
- Hardened privilege elevation on Linux
- FreeBSD ports-based sudo deployment
- Local /usr/local install without package swap
- su replacement alongside sudo-rs