1

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.

bmike
  • 235,889
Siriss
  • 227
  • 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 03 '13 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 03 '13 at 17:48

1 Answers1

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
nohillside
  • 100,768
  • 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 03 '13 at 18:31
  • -i reads .profile from the home directory of the user, in this case from /var/teamserver – nohillside Oct 04 '13 at 03:42