Why am I getting a "dubious ownership of file" error when Launch Agent runs my .plist file? I have a Launch Agent configured to run a .plist file for example: /Library/LaunchAgent/foo.plist. Inside this .plist, it is set to run during LoginWindow and Aqua.

When I attempt to launch my computer and get to the login screen, this plist should run but instead gives the following error (in the console):


  launchctl: Dubious ownership on file (skipping): /Library/LaunchAgents/foo.plist


When I attempt to login in to a non-admin account, it gives the exact same error message. When I attempt to login with an admin account, it works fine.

I'll be honest, I don't know much about Mac OS X privileges and permissions.

To create the file, I opened it up in emacs, with sudo on the admin account (e.g. by using the su command since the other account doesn't have sudo privileges) and then saved it.

Which account do I need to use to create the file so that it works for all users?
Do I need to use the sudo command?
Do I need to change the file permissions (e.g. use chmod)?
Is there an easy way to take an existing file and change its ownership instead of having to recreate the file?
Could someone please explain why this error happens?
If a plist is owned by root and writable by a user other than root, that's a security issue.

You can change the owner to root with sudo chown root &lt;filename&gt;, and change the permissions with sudo chmod 644 &lt;filename&gt; (4 for read access, 2 for write access, 1 for execute access, added up. The first number is for the owner, the second for the group, the third for everyone.)