Sample Header Ad - 728x90

Which command should I use as root to spawn a process with overridden numeric uid/gid/groups?

1 vote
3 answers
1222 views
Which command (available in distro repositories) should I use start a shell with specified numeric uid, gid and groups? Typically su is used to change from root to other user, but it tries to look up groups by names, which may not exist when external filesystems, namespaces and Docker containers are in use. I expect it to be a simple app that just does setgroups(2), setgid(2), setuid(2) and execve(2), without any /etc/passwd or nsswitch. It is easy to implement such a program in C, but maybe something standard and distro-available is used for this use case?
Asked by Vi. (5985 rep)
May 3, 2022, 07:56 PM
Last activity: May 5, 2022, 11:49 AM