{"id":13416422,"url":"https://github.com/ncopa/su-exec","last_synced_at":"2025-05-16T08:05:30.022Z","repository":{"id":37432308,"uuid":"47607657","full_name":"ncopa/su-exec","owner":"ncopa","description":"switch user and group id and exec","archived":false,"fork":false,"pushed_at":"2024-07-12T10:15:09.000Z","size":9,"stargazers_count":987,"open_issues_count":23,"forks_count":101,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-14T14:51:51.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/ncopa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2015-12-08T08:02:04.000Z","updated_at":"2025-05-13T12:55:53.000Z","dependencies_parsed_at":"2024-06-21T02:16:56.208Z","dependency_job_id":"36edb21c-191a-4ed0-b02f-654f5384c905","html_url":"https://github.com/ncopa/su-exec","commit_stats":{"total_commits":13,"total_committers":4,"mean_commits":3.25,"dds":0.5384615384615384,"last_synced_commit":"4c3bb42b093f14da70d8ab924b487ccfbb1397af"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncopa%2Fsu-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncopa%2Fsu-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncopa%2Fsu-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncopa%2Fsu-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncopa","download_url":"https://codeload.github.com/ncopa/su-exec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"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":[],"created_at":"2024-07-30T21:00:58.600Z","updated_at":"2025-05-16T08:05:25.013Z","avatar_url":"https://github.com/ncopa.png","language":"C","readme":"# su-exec\nswitch user and group id, setgroups and exec\n\n## Purpose\n\nThis is a simple tool that will simply execute a program with different\nprivileges. The program will be executed directly and not run as a child,\nlike su and sudo does, which avoids TTY and signal issues (see below).\n\nNotice that su-exec depends on being run by the root user, non-root\nusers do not have permission to change uid/gid.\n\n## Usage\n\n```shell\nsu-exec user-spec command [ arguments... ]\n```\n\n`user-spec` is either a user name (e.g. `nobody`) or user name and group\nname separated with colon (e.g. `nobody:ftp`). Numeric uid/gid values\ncan be used instead of names. Example:\n\n```shell\n$ su-exec apache:1000 /usr/sbin/httpd -f /opt/www/httpd.conf\n```\n\n## TTY \u0026 parent/child handling\n\nNotice how `su` will make `ps` be a child of a shell while `su-exec`\njust executes `ps` directly.\n\n```shell\n$ docker run -it --rm alpine:edge su postgres -c 'ps aux'\nPID   USER     TIME   COMMAND\n    1 postgres   0:00 ash -c ps aux\n   12 postgres   0:00 ps aux\n$ docker run -it --rm -v $PWD/su-exec:/sbin/su-exec:ro alpine:edge su-exec postgres ps aux\nPID   USER     TIME   COMMAND\n    1 postgres   0:00 ps aux\n```\n\n## Why reinvent gosu?\n\nThis does more or less exactly the same thing as [gosu](https://github.com/tianon/gosu)\nbut it is only 10kb instead of 1.8MB.\n\n","funding_links":[],"categories":["Docker Images","C"],"sub_categories":["Base Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncopa%2Fsu-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncopa%2Fsu-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncopa%2Fsu-exec/lists"}