Become

The become utility changes the current effective, or real, user and group identity to those specified on the command line. The default shell (/bin/sh) is then executed.
UID and GID are specified numercially and do not have to be currently defined on the system.

Developer

Dave Armstrong

Usage

become [ -chrv ] [uid][:gid]

Options

-c
Clear supplementary groups.
-h
Display usage information.
-r
Set real IDs instead of effective IDs.
-v
Increase verbosity.

Examples

By default become only changes the effective IDs and leaves any supplemental groups unchanged as shown in the following example:

> become 666:666
euid=666, uid=0, egid=666, gid=0
$ id
uid=0(root) euid=666 gid=0(wheel) egid=666 groups=666, 0(wheel)

Supplementary groups are cleared when the "-c" option is used:

> become -c 123:123
euid=123, uid=0, egid=123, gid=0
$ id
uid=0(root) euid=123 gid=0(wheel) egid=123 groups=123

When the "-r" option is used become effects real IDs rather than effective IDs:

> become -r 626:3203
euid=626, uid=626, egid=3203, gid=3203
$ id
uid=626 gid=3203 groups=3203, 0(wheel)

Download

The latest version of become can be obtained from: