runuser
Run commands as a user and group without asking for password. tldr-pages
On Linux
Linux
Run command as a different user
sudo runuser user --command 'command'IdentifyRun command as a different user and group
sudo runuser user --group group --command 'command'IdentifyStart a login shell as a specific user
sudo runuser user --loginIdentifySpecify a shell for running instead of the default shell (also works for login)
sudo runuser user --shell /bin/shIdentifyMatches documented abuse: shell
Preserve the entire environment of root (only if --login is not specified)
sudo runuser user --preserve-environment --command 'command'Identify