How can I login as the _teamsserver user? I have sudoed and set the passwd for teamsserver, but it does not take it when I use the login command. I need to see the output of some scripts as they are run by teamsserver, and verify that teamsserver has the correct permissions and utilities available.

  • I usually just use sudo to look at any log files (or sudo -s to get a root shell), would this work for you as well?
    – nohillside
    Oct 3, 2013 at 17:47
  • No, I can do that, but I need to run a script as teamsserver. I need to make sure the teamsserver user has all the correct utilities and permissions.
    – Siriss
    Oct 3, 2013 at 17:48

1 Answer 1


To just look at log files etc. I usually use either

sudo less /path/to/log/file

or (in case I need root access longer) run sudo -s to get a root shell.

To run processes as another user you can use

sudo -H -u _teamserver cmd-to-run

And finally, to simulate a login there is

sudo -H -u _teamserver -i
  • Actually, it seems to work, but it is still not running as teamsserver. When I check (echo $ENVVAR) an environment variable that I know is set in teamsserver, it does not show
    – Siriss
    Oct 3, 2013 at 18:31
  • -i reads .profile from the home directory of the user, in this case from /var/teamserver
    – nohillside
    Oct 4, 2013 at 3:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .