# User Check

> How do you check which user a process runs as inside a container without opening an interactive shell, and why does it matter?

Canonical: https://www.internhack.in/learn/interview/docker-containers/docker-user-id-check
Last updated: 2026-11-28

Difficulty: Beginner

## Question

How do you check which user a process runs as inside a container without opening an interactive shell, and why does it matter?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

Container user (UID/GID), docker exec id, USER instruction, Running as non-root, docker top

Previous: [Filtering Images](https://www.internhack.in/learn/interview/docker-containers/docker-image-filtering) · [All of Docker & Containers](https://www.internhack.in/learn/interview/docker-containers)

## More Docker & Containers questions

- [CMD vs. ENTRYPOINT](https://www.internhack.in/learn/interview/docker-containers/docker-cmd-vs-entrypoint)
- [Multi-stage Builds](https://www.internhack.in/learn/interview/docker-containers/docker-multi-stage-builds)
- [Volumes vs. Bind Mounts](https://www.internhack.in/learn/interview/docker-containers/docker-volumes-vs-bind-mounts)
- [COPY vs. ADD](https://www.internhack.in/learn/interview/docker-containers/docker-copy-vs-add)
- [Docker Compose](https://www.internhack.in/learn/interview/docker-containers/docker-compose-purpose)
- [Networking Drivers](https://www.internhack.in/learn/interview/docker-containers/docker-networking-drivers)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Docker & Containers](https://www.internhack.in/learn/interview/docker-containers)
