You can run commands as different users in Ubuntu using sudo and su. With sudo Just use the following params: -H to load the Home environment variables of the user. -u to run the command as another user. -c to execute a bash command. Or just become the user using the -i flag to invoke the login shell and -u …