{"id":16858135,"url":"https://github.com/ogham/minisudo","last_synced_at":"2025-04-11T07:48:57.745Z","repository":{"id":66117933,"uuid":"260557166","full_name":"ogham/minisudo","owner":"ogham","description":"A little privilege escalator in Rust, for learning.","archived":false,"fork":false,"pushed_at":"2020-05-02T18:50:24.000Z","size":19,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T05:27:27.078Z","etag":null,"topics":["pam","sudo","unix"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ogham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-01T20:58:19.000Z","updated_at":"2024-12-19T08:15:47.000Z","dependencies_parsed_at":"2023-02-20T18:01:01.451Z","dependency_job_id":null,"html_url":"https://github.com/ogham/minisudo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogham%2Fminisudo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogham%2Fminisudo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogham%2Fminisudo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogham%2Fminisudo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ogham","download_url":"https://codeload.github.com/ogham/minisudo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248359645,"owners_count":21090562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pam","sudo","unix"],"created_at":"2024-10-13T14:11:43.750Z","updated_at":"2025-04-11T07:48:57.725Z","avatar_url":"https://github.com/ogham.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minisudo [![Build status](https://travis-ci.org/ogham/minisudo.svg)](https://travis-ci.org/ogham/minisudo)\n\nThis is a small sudo-like privilege escalator for Unix-like operating systems.\n\nIt was written for learning, not to replace sudo, and has been tested on macOS and Linux.\n\n```\n$ minisudo whoami\nPassword for ben: [password hidden]\nroot\n```\n\nThis project was inspired by [kibi](https://github.com/ilai-deutel/kibi), a text editor written in ≤1024 lines of code. I’ve seen many people with the false impression that `sudo` is “magical” or special in some way, but it doesn’t do anything that’s not available to any other program. minisudo tries to implement its most popular use case — running programs as root after checking against a list of rules — with a couple pages of code and minimal dependencies.\n\n\nInstallation\n------------\n\nminisudo is written in [Rust](https://www.rust-lang.org/), and uses [just](https://github.com/casey/just) as its build script runner. To build and install:\n\n    $ just build\n    $ sudo just install\n\nTo uninstall:\n\n    $ sudo just uninstall\n\nDebian users will need to have the `libpam0g-dev` package installed.\n\n\nHow it works\n------------\n\nminisudo uses [PAM](https://en.wikipedia.org/wiki/Pluggable_authentication_module) as its authentication mechanism, which is how it knows what your password is. It installs a file into `/etc/pam.d` to allow it to do this.\n\nThe binary is installed with the [setuid bit](https://en.wikipedia.org/wiki/Setuid) set, which is how it’s able to run programs as root.\n\n\nRules file\n----------\n\nThe rules for which users can run which programs are specified in a TOML file, `/etc/minisudo-rules.toml`. Here’s an example:\n\n```toml\n# The user ‘ben’ can run ‘ls’, but nothing else.\n[[rule]]\nuser = \"ben\"\nprogram = \"/bin/ls\"\n\n# All members of the ‘staff’ group can run ‘whoami’, but nothing else.\n[[rule]]\ngroup = \"staff\"\nprogram = \"/usr/bin/whoami\"\n```\n\nBinaries must be specified by their _full path_, not just their basename. Specify `*` to allow any program to be run.\n\n\nSafety\n------\n\nAlthough no unsafe Rust code is present in the `minisudo` crate itself, its dependencies call functions in PAM and libc, so the project can never be _entirely_ free of unsafe code.\n\n\nSecurity vulnerabilities\n------------------------\n\nProbably.\n\n\nLicence\n-------\n\nminisudo’s source code is under the [MIT Licence](LICENCE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogham%2Fminisudo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fogham%2Fminisudo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogham%2Fminisudo/lists"}