Allow running commands using another user/group.

Fixes #6387