This article covers the most common reasons an Automox agent installation on macOS fails when run from Terminal, and how to resolve each one. Work through these in order, since the first two account for most failures.
1. Confirm the account has local administrator rights
The installation and key-registration commands are run with sudo, which requires the logged-in account to have local administrator rights on the Mac. If the account does not, Terminal reports that the user is not in the sudoers file and the installation stops before anything is installed.
Run the installation from an account with local administrator rights, or have an administrator run it on the device. A standard user account cannot complete this installation even with the correct access key.
2. Verify the access key was pasted in full
An incomplete or mistyped access key is a frequent cause of an install that appears to succeed but never connects. The agent registers but authentication fails, and the agent log records an Unauthorized response with an Invalid Access Key message.
If the key needs to be corrected after installation, set it directly:
sudo /usr/local/bin/amagent --setkey ACCESS_KEY
Then restart the agent so it re-registers with the corrected key:
sudo launchctl kickstart -k system/com.automox.agent
Copy the key from the console rather than retyping it, and confirm no characters were dropped at the start or end of the paste.
3. If the pasted command behaves unexpectedly in your shell
macOS uses zsh as the default shell. In some environments a command pasted into Terminal is not interpreted as intended, and running the same command in bash resolves it. If the command fails in a way that looks like the shell mishandled it, rather than a permissions or key error, switching shells is worth trying.
Check the current shell:
echo $SHELL
Switch to bash for the installation:
exec bash
Return to zsh afterward:
exec zsh
This is environment-specific and is not the usual cause of a failed installation. If switching shells does not change the result, the problem is elsewhere, so return to the checks above and then collect logs.
4. When the installer itself fails
If the package downloads but the installation fails partway through, the agent log is the place to start:
sudo tail -f /var/log/amagent/amagent.log
This shows registration and authentication activity, including access key failures and connection errors. For ways to collect this log without working directly on the endpoint, see Retrieving Automox Agent logs.
If the device is enrolled in an MDM solution, confirm the MDM is not also managing or blocking the agent, since a failure that reproduces through both Terminal and the graphical installer usually points to something on the device rather than to the install method.
Full installation steps
For the complete installation procedure across platforms, see Automox Agent Installation Overview.