Prozess unter einem anderen Benutzer starten sudo -H -u otheruser bash -c 'echo "I am $USER, with uid $UID"' Wobei mit -c erst der eigentlich auszuführende Befehl festgelegt wird Auszug aus den sudo-Manpages: -H The -H (HOME) option requests that the security policy setthe HOME environment variable to the home directory of thetarget user (root by default) as specified by the passworddatabase. Depending on the policy, this may be the defaultbehavior. -u user The -u (user) option causes sudo to run the specifiedcommand as a user other than root. To specify a uidinstead of a user name, use #uid. When running commands asa uid, many shells require that the '#' be escaped with abackslash ('\'). Security policies may restrict uids tothose listed in the password database. The sudoers policyallows uids that are not in the password database as longas the targetpw option is not set. Other security policiesmay not support this.