[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5865":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},5865,"sudo-rs","trifectatechfoundation\u002Fsudo-rs","trifectatechfoundation","A memory safe implementation of sudo and su.",null,"Rust",4399,168,32,72,0,5,9,29,15,28.68,"Apache License 2.0",false,"main",[],"2026-06-12 02:01:15","# sudo-rs\n\nA safety oriented and memory safe implementation of sudo and su written in Rust.\n\n## Status of this project\n\nSudo-rs is being actively maintained; features you might expect from original sudo\nmay still be unimplemented or not planned. Also note our [frequently asked questions](FAQ.md).\n\nIf there is an important one you need, please request it using the issue tracker. If you encounter any usability bugs,\nalso please report them on the [issue tracker](https:\u002F\u002Fgithub.com\u002Ftrifectatechfoundation\u002Fsudo-rs\u002Fissues).\nSuspected vulnerabilities can be reported on our [security page](https:\u002F\u002Fgithub.com\u002Ftrifectatechfoundation\u002Fsudo-rs\u002Fsecurity).\n\nSudo-rs has been audited twice: an audit of version 0.2.0 was performed in August 2023, and a second audit of version 0.2.8 in August 2025. The audit reports can be found [here](docs\u002Faudit).\n\nSudo-rs currently is targeted for FreeBSD and Linux-based operating systems only.\n\n## Installing sudo-rs\n\nYou can install sudo-rs using the package manager of your Linux distribution. Many Linux distributions will also keep\noriginal sudo installed and so offer sudo-rs using modified command names. You can work around that by creating e.g. an `alias`, but that will\nonly change your own invocations of `sudo` to sudo-rs and not affect other programs and scripts that use `sudo`.\n\nTo avoid that and\u002For to get the latest version, you can use our prepackaged binaries (see below).\n\n### Ubuntu 25.10 (Questing Quokka)\n\nsudo-rs is installed and enabled by default; you can control which sudo version is being used by running\n\n```sh\nupdate-alternatives --config sudo\n```\n\nThe sudo-rs package is based on v0.2.8 with additional bug fixes that will be part of v0.2.9.\n\n### Arch Linux\n\nsudo-rs can be installed from the distribution repositories:\n\n```sh\npacman -S sudo-rs\n```\n\nThis will offer the functionality using the commands `sudo-rs`, `sudoedit-rs`, `visudo-rs` and `su-rs` to avoid conflicts.\n\nThe sudo-rs package on Arch Linux is typically up-to-date.\n\n### Fedora\n\nOn Fedora you can use:\n\n```sh\ndnf install sudo-rs\n```\n\nThis will offer the functionality using the commands `sudo-rs`, `visudo-rs` and `su-rs` to avoid conflicts.\n\nThe version packaged in Fedora is usually the latest.\n\n### Debian\n\nIf you are running Debian 13 (trixie) or later you can use:\n\n```sh\napt-get install sudo-rs\n```\n\nThis will offer the functionality using the commands `sudo-rs`, `visudo-rs`. If you want to invoke sudo-rs\nvia the usual commands `sudo` and `visudo` instead, prepend `\u002Fusr\u002Flib\u002Fcargo\u002Fbin` to your current `$PATH` variable.\n\nThe sudo-rs version packaged in Debian 13 (trixie) is based on release 0.2.5 from April 2025 which is missing `sudoedit`, `NOEXEC:`,\nand many other usability and compatibility improvements, but is up-to-date with respect to security patches. Due to a misconfiguration\nin this package, `su-rs` cannot be used because it does not have the setuid flag set.\n\nDebian unstable (sid) may have a newer version.\n\n### FreeBSD\n\nWe are maintaining the FreeBSD port of sudo-rs ourselves, which is available in the ports tree. Sudo-rs is available in two flavours:\n\n```sh\npkg install sudo-rs\n```\n\nTo get sudo-rs using the commands `sudo`, `visudo` and `sudoedit`. This conflicts with the `security\u002Fsudo` package and so you cannot have both\ninstalled at the same time.\n\nAlternatively,\n\n```sh\npkg install sudo-rs-coexist\n```\n\nInstalls the commands as `sudo-rs`, `visudo-rs`' and `sudoedit-rs` and does not conflict with the `security\u002Fsudo` package.\n\nTo run these commands, the `pkg` utility needs to be using the `2025Q4` quarterly version (or later) of the ports tree. To use the\nabsolute latest version, you can [switch from quarterly to `latest`](https:\u002F\u002Fwiki.freebsd.org\u002FPorts\u002FQuarterlyBranch#How_to_switch_from_quarterly_to_latest).\n\n### NixOS\n\nOn NixOS sudo-rs can be installed by adding the following to your configuration:\n\n```nix\nsecurity.sudo-rs.enable = true;\n```\n\nThis will replace the usual `sudo` and `sudoedit` commands.\n\n### Alpine Linux\n\nOn Alpine Linux, sudo-rs is in the *community* repository, and can be installed as:\n\n```sh\napk add sudo-rs\n```\n\nThis will install the `sudo`, `visudo` and `sudoedit` commands (but not replace `su`, which is still offered through BusyBox).\n\n### Installing our pre-compiled x86-64 binaries\n\nYou can also switch to sudo-rs manually by using our pre-compiled tarballs.\nWe currently only offer these for x86-64 Linux systems.\n\nWe recommend installing sudo-rs and su-rs in your `\u002Fusr\u002Flocal` hierarchy so it does not affect the integrity of the package\nmanager of your Linux distribution. You can achieve this using the commands:\n\n```sh\nsudo tar -C \u002Fusr\u002Flocal -xvf sudo-0.2.13.tar.gz\n```\n\nand for su-rs:\n\n```sh\nsudo tar -C \u002Fusr\u002Flocal -xvf su-0.2.13.tar.gz\n```\n\nThis will install sudo-rs and su-rs in `\u002Fusr\u002Flocal\u002Fbin` using the usual commands `sudo`, `visudo`, `sudoedit` and `su`. Please double check\nthat in your default `PATH`, the folders `\u002Fusr\u002Flocal\u002Fbin` and `\u002Fusr\u002Flocal\u002Fsbin` have priority over `\u002Fusr\u002Fbin` and `\u002Fusr\u002Fsbin`.\n\nIf you **don't** have Todd Miller's `sudo` installed, you also have to make sure that:\n\n* You manually create a `\u002Fetc\u002Fsudoers` or `\u002Fetc\u002Fsudoers-rs` file, this could be as simple as:\n\n      Defaults secure_path=\"\u002Fusr\u002Flocal\u002Fsbin:\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fsbin:\u002Fusr\u002Fbin:\u002Fsbin:\u002Fbin\"\n\n      %sudo ALL=(ALL:ALL) ALL\n\n  `sudo-rs` will try to process `\u002Fetc\u002Fsudoers-rs` if it exists, otherwise it will use `\u002Fetc\u002Fsudoers`.\n  For an explanation of the sudoers syntax you can look at the\n  [sudoers man page](https:\u002F\u002Fwww.sudo.ws\u002Fdocs\u002Fman\u002Fsudoers.man\u002F).\n\n* (Strongly recommended) You create `\u002Fetc\u002Fpam.d\u002Fsudo` and `\u002Fetc\u002Fpam.d\u002Fsudo-i` files that contain (for Debian\u002FUbuntu):\n\n      session required pam_limits.so\n\n      @include common-auth\n      @include common-account\n      @include common-session-noninteractive\n\n  If you don't do this, either a \"fallback\" PAM policy will be used or `sudo-rs` will simply refuse to run\n  since it cannot initialize PAM. On Fedora, the syntax for PAM configuration is slightly different, but the\n  correct PAM configuration files will most likely be already installed.\n  On FreeBSD, you may want to put these files in `\u002Fusr\u002Flocal\u002Fetc\u002Fpam.d` instead.\n\n### Building from source\n\nSudo-rs is written in Rust. The minimum required Rust version is 1.85. If your\nLinux distribution does not package that version (or a later one), you can always\ninstall the most recent version through [rustup]. You also need the C development\nfiles for PAM (`libpam0g-dev` on Debian, `pam-devel` on Fedora). If you want to\ninstall translated messages, you also need gettext tools for `msgfmt` (`gettext`\non Debian and Ubuntu).\n\nOn Ubuntu or Debian-based systems, use the following command to install the PAM development library:\n\n```sh\nsudo apt-get install libpam0g-dev\n```\n\nOn Fedora, CentOS and other Red Hat-based systems, you can use the following command:\n\n```sh\nsudo yum install pam-devel\n```\n\nWith dependencies installed, building sudo-rs is a simple matter of:\n\n```sh\ncargo build --release\n```\n\nThis produces a binary `target\u002Frelease\u002Fsudo`. However, this binary must have\nthe setuid flag set and must be owned by the root user in order to provide any\nuseful functionality. Consult your operating system manual for details.\n\nSudo-rs then also needs the configuration files; please follow the installation\nsuggestions in the previous section.\n\n### Feature flags\n\n#### --features pam-login\n\nBy default, sudo-rs will use the PAM service name `sudo`. On Debian and Fedora\nsystems, it is customary that the name `sudo-i` is used when the `-i \u002F --login`\ncommand line option is used. To get this behaviour, enable the `pam-login`\nfeature when building:\n\n```sh\ncargo build --release --features pam-login\n```\n\nThis feature is enabled on our pre-supplied binaries.\n\n#### --features apparmor\n\nsudo-rs has support for selecting AppArmor profile on Linux distributions that\nsupport AppArmor such as Debian and Ubuntu. To enable this feature, build sudo-rs\nwith apparmor support enabled:\n\n```sh\ncargo build --release --features apparmor\n```\n\nThis feature is disabled on our pre-supplied binaries.\n\n#### --features gettext\n\nsudo-rs has support for translated user-facing messages. To enable this feature,\nbuild sudo-rs with gettext support enabled:\n\n```sh\ncargo build --release --features gettext\n```\n\nYou can install the translation files from `po\u002F*.po` using:\n\n```sh\nsudo make install-mo\n```\n\nThis uses `msgfmt` to compile each `\u003Clang>.po` file to\n`\u002Fusr\u002Fshare\u002Flocale\u002F\u003Clang>\u002FLC_MESSAGES\u002Fsudo-rs.mo`. If needed, you can override\nthe install location by setting `LOCALEDIR` when invoking `make`.\n\n[rustup]: https:\u002F\u002Frustup.rs\u002F\n\n## Differences from original sudo\n\nsudo-rs supports less functionality than sudo. Some of this is by design. In\nmost cases you will get a clear error if you try something that is not\nsupported (e.g. use a configuration flag or command line option that is not\nimplemented).\n\nExceptions to the above, with respect to your `\u002Fetc\u002Fsudoers` configuration:\n\n* `use_pty` is enabled by default, but can be disabled.\n* `env_reset` is ignored --- this is always enabled.\n* `visiblepw` is ignored --- this is always disabled.\n* `pwfeedback` is enabled by default, but can be disabled.\n* `verifypw` is ignored --- this is always set to `all` (the default)\n* the (NO)PASSWD tag on the \"list\" pseudocommand will determine whether a password\n  is required for the `sudo -U --list` command, instead of `listpw`.\n* `mail_badpass`, `always_set_home`, `always_query_group_plugin` and\n  `match_group_by_gid` are not applicable to our implementation, but ignored for\n  compatibility reasons.\n* `timestamp_type` is always set at `tty`.\n* `sudoedit_checkdir` is always `on`, and `sudoedit_follow` is always `off`.\n* `logfile` is not supported --- logging is always done via syslog.\n\nSome other notable restrictions to be aware of:\n\n* Some functionality is not supported, such as preventing shell escapes using `INTERCEPT` and\n  storing config in LDAP using `sudoers.ldap`, and `cvtsudoers`. This includes `sudo -E`,\n  which is [discouraged](https:\u002F\u002Fwww.sudo.ws\u002Fdocs\u002Ftroubleshooting\u002F#why-does-sudo-modify-the-commands-environment) in original sudo.\n* Sudo-rs always uses PAM for authentication, so your system must be set up for PAM.\n  Sudo-rs will use the `sudo` and `sudo-i` service configuration. This also means\n  that resource limits, umasks, etc have to be configured via PAM and not through\n  the sudoers file.\n* sudo-rs will not include the sendmail support of original sudo.\n* The sudoers file must be valid UTF-8.\n* To prevent a common configuration mistake in the sudoers file, wildcards\n  are only supported in *argument positions* for a command as the final argument.\n  E.g., `%sudoers ALL = \u002Fsbin\u002Ffsck*` will allow `sudo fsck` and `sudo fsck_exfat` as expected,\n  and `%sudoers ALL = \u002Fsbin\u002Fservice ntp *` will allow a user to control the `ntp` service.\n  but `%sudoers ALL = \u002Fbin\u002Frm *.txt` will not allow an operator to run `sudo rm README.txt`,\n  nor `sudo rm -rf \u002Fhome .txt`, as with original sudo.\n\nIf you find a common use case for original sudo missing, please create a feature\nrequest for it in our issue tracker.\n\n## Aim of the project\n\nOur current target is to build a drop-in replacement for all common use cases of\nsudo. For the sudoers config syntax this means that we support the default\nconfiguration files of common Linux distributions. Our implementation should support\nall commonly used command line options from the original sudo implementation.\n\nSome parts of the original sudo are explicitly not in scope. Sudo has a large\nand rich history and some of the features available in the original sudo\nimplementation are largely unused or only available for legacy platforms. In\norder to determine which features make it we both consider whether the feature\nis relevant for modern systems, and whether it will receive at very least\ndecent usage. Finally, of course, a feature should not compromise the safety of\nthe whole program.\n\nOur `su` implementation is made using the building blocks we created for our\nsudo implementation.  It is a suitable replacement for the `su` distributed\nby [util-linux].\n\n[util-linux]: https:\u002F\u002Fgithub.com\u002Futil-linux\u002Futil-linux\n\n## Future work\n\nWhile our initial target is a drop-in replacement for most basic use cases of\nsudo, our work may evolve beyond that target. We are also looking into\nalternative ways to configure sudo without the sudoers config file syntax and to\nextract parts of our work in usable crates for other people.\n\n## History\n\nThe initial development of sudo-rs was started and funded by the [Internet Security Research Group](https:\u002F\u002Fwww.abetterinternet.org\u002F) as part of the [Prossimo project](https:\u002F\u002Fwww.memorysafety.org\u002F)\n\n## Acknowledgements\n\nSudo-rs is an independent implementation, but it incorporates documentation and Rust translations of code from [sudo](https:\u002F\u002Fwww.sudo.ws\u002F), maintained by Todd C. Miller. We thank Todd and the other sudo contributors for their work.\n\nAn independent security audit of sudo-rs was made possible by the [NLNet Foundation](https:\u002F\u002Fnlnet.nl\u002F), who also [sponsored](https:\u002F\u002Fnlnet.nl\u002Fproject\u002Fsudo-rs\u002F) work on increased compatibility with the original sudo and the FreeBSD port.\n\nThe sudo-rs project would not have existed without the support of its sponsors, a full overview is maintained at \u003Chttps:\u002F\u002Ftrifectatech.org\u002Finitiatives\u002Fprivilege-boundary\u002F>\n","sudo-rs 是一个用 Rust 语言编写的、注重安全性和内存安全的 sudo 和 su 命令实现。该项目的核心功能包括提供与传统 sudo 类似的权限提升能力，同时利用 Rust 的内存安全性来减少潜在的安全漏洞。技术特点上，sudo-rs 支持 FreeBSD 和基于 Linux 的操作系统，并且经过了多次安全审计以确保其可靠性。适用于需要增强系统安全管理但又希望避免 C 语言版本 sudo 可能带来的安全风险的企业或个人用户。安装方面，可以通过多种 Linux 发行版的包管理器直接获取，同时也提供了预编译的二进制文件供下载使用。",2,"2026-06-11 03:05:12","top_language"]