I need to sudo as a different used in order to execute a certain command. I am trying to use strace with it and redirecting the output of that into a file for further analysis. The tricky part is that as the sudo'ed user I don't have permissions to write to the location I want to save my file in. (and without sudo'ing I don't have permission to execute that command to begin with).
So how can I execute my command as user A, and redirect it's output as user B?