setuser - Run a command as a specified user |
setuser user command [ arg ... ] |
setuser sets the uid, group id, and supplementary groups from the given user name, then execs the given program with the given command line arguments. If the exec fails, this process exits with nonzero status. If it succeeds, it exits with the status of the program exec replaces it with. |
Compared with "su", the setuser command is more oriented to programmatic usage. It does not start a shell, and it does not create an extra process to control the one that runs as the given user -- a process that may ignore various signals. The command line arguments are not re-parsed as in "su -c". It just sets user and group ids, then runs the requested command. |
If the effective user is already the requested one, this command is a no-op. |
startstop(8), monitor(8) |