# tianon/gosu

Simple Go-based setuid+setgid+setgroups+exec

Repository: https://github.com/tianon/gosu
Canonical: https://ross.abutalabs.com/products/gosu
Language: Shell
License: Apache-2.0
License Family: permissive
Last push: 2026-06-06T05:15:55+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 86, release rhythm 48, longevity 100
- inputs: {"age_days": 4496, "days_push": 88, "days_rel": 344, "gap_med": 18, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5000, forks 356 (observed 2026-08-28T04:09:04.488892+00:00)

## What it is
gosu is a small Go-based CLI tool for switching to another user (setuid/setgid/setgroups) and exec'ing a command, designed as a lightweight replacement for su/sudo in containers. It avoids TTY and signal-forwarding problems by exec'ing the target process so gosu is no longer resident.

## Use cases
- drop from root to a non-privileged user in a docker entrypoint
- run a command as another user inside a container without su or sudo
- avoid signal and tty forwarding issues when switching users
- specify user and group by name or uid/gid when launching a process
- run container applications as unprivileged users

## When to choose
- you need to step down from root to a normal user during container startup
- su or sudo cause signal or TTY problems in your container entrypoint
- you want a tiny static binary with no configuration files

## When to avoid
- you need general-purpose privilege escalation or sudo policy features
- you want to use gosu to step up to root, which may be vulnerable (e.g. CVE-2016-2779)
- you are not on Linux

## Facets
- artifact type: cli-tool
- maturity: stable
- function: security, developer-tools, cli
- domain: developer-tools
- platform: cli
- tags: setuid, docker-entrypoint, user-switching, container-startup, drop-privileges, containers, devops, linux, docker

## Member repositories
- tianon/gosu (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:04.488892+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-29T18:17:35.901933+00:00, confidence not recorded.
  - readme: https://github.com/tianon/gosu (fetched 2026-08-28T04:09:04.488892+00:00, sha 834945721bf5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
