# ncopa/su-exec

switch user and group id and exec

Repository: https://github.com/ncopa/su-exec
Canonical: https://ross.abutalabs.com/products/su-exec
Language: C
License: MIT
License Family: permissive
Last push: 2025-10-07T13:49:01+00:00

## Health v2 (maintenance only)
Score: 47/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 45, release rhythm 19, longevity 100
- inputs: {"age_days": 3921, "days_push": 330, "days_rel": 330, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1023, forks 103 (observed 2026-08-28T04:03:16.173985+00:00)

## What it is
su-exec is a tiny C utility that switches user and group id and directly execs a program, avoiding the TTY and signal issues of su/sudo child processes. It is a lightweight 10kb alternative to gosu, commonly used in Docker entrypoints to drop root privileges.

## Use cases
- drop root privileges when starting a process in a docker container
- run a command as another user without a child shell process
- replace gosu with a smaller binary in container images
- exec a service as a specific uid:gid in an entrypoint script
- avoid TTY and signal forwarding problems when switching users

## When to choose
- you need a minimal, dependency-free setuid helper for Alpine or other Linux containers
- signal handling and PID 1 behavior matter in your container entrypoint

## When to avoid
- you need full sudo/su features like authentication, logging, or command policies
- you are on a non-Linux platform or cannot run as root

## Facets
- artifact type: cli-tool
- maturity: stable
- function: security, cli
- domain: developer-tools
- platform: cli
- tags: setuid, docker-entrypoint, gosu-alternative, privilege-drop, c, containers, command-line, linux, docker

## Member repositories
- ncopa/su-exec (main) score 47

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:16.173985+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:08:38.938988+00:00, confidence not recorded.
  - readme: https://github.com/ncopa/su-exec (fetched 2026-08-28T04:03:16.173985+00:00, sha bcee08a16cca)
- Data as of 2026-08-30T08:39:29.467469+00:00.
