{"id":15031054,"url":"https://github.com/thimslugga/su-exec-rs","last_synced_at":"2026-03-16T16:32:40.886Z","repository":{"id":254760330,"uuid":"847457168","full_name":"thimslugga/su-exec-rs","owner":"thimslugga","description":"A simple tool written in rust to switch the user and group id and then exec.","archived":false,"fork":false,"pushed_at":"2024-10-13T21:10:53.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T06:16:38.319Z","etag":null,"topics":["containers","docker","gosu","linux","rust","rust-lang","su","sudo"],"latest_commit_sha":null,"homepage":"https://github.com/thimslugga/su-exec-rs","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/thimslugga.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["thimslugga"],"buy_me_a_coffee":"thimslugga"}},"created_at":"2024-08-25T21:45:54.000Z","updated_at":"2024-10-13T21:13:34.000Z","dependencies_parsed_at":"2024-08-25T23:45:44.109Z","dependency_job_id":"5fd055b1-56d2-43d5-94fa-6efcc4a996a7","html_url":"https://github.com/thimslugga/su-exec-rs","commit_stats":null,"previous_names":["thimslugga/su-exec-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thimslugga%2Fsu-exec-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thimslugga%2Fsu-exec-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thimslugga%2Fsu-exec-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thimslugga%2Fsu-exec-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thimslugga","download_url":"https://codeload.github.com/thimslugga/su-exec-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243382783,"owners_count":20282007,"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":["containers","docker","gosu","linux","rust","rust-lang","su","sudo"],"created_at":"2024-09-24T20:14:48.440Z","updated_at":"2025-12-29T16:05:09.477Z","avatar_url":"https://github.com/thimslugga.png","language":"Rust","funding_links":["https://github.com/sponsors/thimslugga","https://buymeacoffee.com/thimslugga"],"categories":[],"sub_categories":[],"readme":"# su-exec-rs\n\nswitch user and group id, setgroups and exec.\n\n## Description\n\nsu-exec-rs is a simple tool written in rust that will simply execute a program with different privileges. The program will be executed directly and it will not run as a child process (e.g. su and sudo). This avoids TTY and signal issues.\n\n**Note: `su-exec-rs` depends on being run by the root user as non-root users do not have the necessary permissions to be able to change uid and gid.**\n\n## Usage\n\nUsage:\n\n```shell\nsu-exec-rs user-spec command [args]\n```\n\n**Note: *user-spec* is either a user name (e.g. nobody) OR username + group name separated by a colon (e.g. nobody:ftp). Numeric uid/gid values can also be used instead of string names.**\n\nAs the root user:\n\n```shell\nsu-exec-rs ubuntu:1000 /usr/sbin/caddy -conf /etc/Caddyfile\n```\n\nFor example:\n\n```shellsession\n$ time docker run --rm -it ubuntu:latest su ubuntu -c 'ps aux'\nUSER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nroot           1 23.5  0.0   4332  2816 pts/0    Ss+  22:03   0:00 su ubuntu -c ps aux\nubuntu         7  0.0  0.0   8280  4224 ?        Rs   22:03   0:00 ps aux\n\nreal 0m0.554s\nuser 0m0.019s\nsys 0m0.025s\n```\n\n```shellsession\n$ time docker run --rm -it -v $PWD/su-exec-rs:/sbin/su-exec-rs:ro ubuntu:latest su-exec-rs ubuntu ps aux\nUSER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nubuntu         1 23.5  0.0   7888  3712 pts/0    Rs+  22:05   0:00 ps aux\n\nreal 0m0.537s\nuser 0m0.017s\nsys 0m0.026s\n```\n\n## Building\n\nBuilding is done with [just](https://github.com/casey/just) and [cargo](https://github.com/rust-lang/cargo).\n\n```shell\njust build\n```\n\n## Why bother when su-exec and gosu already exist?\n\nWhile this does more or less the same thing as [su-exec](https://github.com/ncopa/su-exec) and [gosu](https://github.com/tianon/gosu), it is written in rust-lang instead of C or Golang.\n\n## License\n\nThis project is licensed under the MIT License, see the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthimslugga%2Fsu-exec-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthimslugga%2Fsu-exec-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthimslugga%2Fsu-exec-rs/lists"}