system
August 15, 2011, 7:44pm
1
(imported topic written by pdentremont91)
Hi Guys,
I’m trying to run an apple script that runs as current user basically need to configure Outlook 2011 on a machine for a user that already exists so i can’t use the template. As BigFix runs as root, and is a true multiuser os, what is the best way to accomplish this? If someone has a better way of accomplishing this please let me know.
Thanks,
Thanks,
Peter d’Entremont
leewei
August 15, 2011, 8:18pm
2
(imported comment written by Lee Wei)
You can use the UNIX switch user (su) command.
For example, for a per-command basis, it would be:
su user -c command
A example of an ActionScript (not tested)
delete __appendfile
appendfile #!/bin/sh
appendfile su leewei -c “/usr/bin/some_command”
delete "/tmp/runcommand.sh"
copy __appendfile “/tmp/runcommand.sh”
wait chmod +x "/tmp/runcommand.sh"
wait chown leewei "/tmp/runcommand.sh"
wait “/tmp/runcommand.sh”
Lee Wei
1 Like
system
August 15, 2011, 8:41pm
3
(imported comment written by pdentremont91)
OK that seems good. But I also need to dynamically identify the user and if i am running as root do I need a password for the su user?
Peter d’Entremont
leewei
August 15, 2011, 9:47pm
4
(imported comment written by Lee Wei)
{name of current user} will dynamically replace the static username with the actual logged on user.
The UNIX su command does not require password if you are root.
The TEM Agent does run as root, so no password required.