The Backup Agent That Would Not Install on cPanel — TMPDIR, noexec and a Folder Nobody Checks
A backup war story about installing a Veeam management agent on a cPanel server — the temporary folder almost nobody checks — and the four-line install I now run on every cPanel box.
The customer had signed for cloud backup the week before. One production cPanel server, a few hundred sites, mail on the same box.
“It’s a five-minute job,” someone said on the call. “Download the agent, run the script as root, done.”
I ran the script as root.
It stopped on the second line of output.
./getcomputerinfo: Permission denied
“You’re root,” came the reply. “How can root get Permission denied?”
That is the question this article answers. Root was not the problem. The folder the script unpacked itself into was.
The Trap — Root Is Not Enough When the Folder Says No
That’s the trap. “Permission denied” as root does not look like a folder problem. It looks like a broken package, a bad download, or a SELinux story. It hides in plain sight in two mount options and one environment variable.
Here’s the part that trips people up: I fixed the first error, the package installed, and the agent still did not work. The second failure was quieter and took longer to find than the first. Both had the same cause.
What Actually Happens When the Installer Runs
The management agent comes from the service-provider console as a self-extracting .sh file. It is not a generic package: the company identity is baked in, so each customer gets their own download. When you run it, the flow is:
installer.sh → mktemp -t → $TMPDIR (or /tmp) → unpack helpers → run helpers → install package → configurator writes config
Two things matter in that flow.
mktemp -tuses$TMPDIR. If the variable is empty, it uses/tmp. Whatever folder that is, the installer unpacks small binaries there and runs them from there.- The configurator does not run as root. After the package is installed, a step runs as a dedicated service user (
veeam-usr-vspc-agent) and reads a file from that same temporary folder.
So the temporary folder must allow two things: executing binaries, and being read by a non-root user. On a cPanel server, the two obvious choices each break one of them.
This is common on:
- cPanel and WHM servers, where
/tmpis mountednoexecas a hardening default. - Any server hardened to a CIS-style baseline, where
/tmpand/var/tmpcarrynoexec,nosuid. - Shell sessions that set
TMPDIRto a private folder under/rootto work around the first problem.
Failure One — /tmp Is noexec
On a cPanel server, /tmp is a separate mount with noexec. That is good hardening — it stops a lot of web-shell droppers from running what they write — and it is exactly what the installer trips on. The script unpacks getcomputerinfo into /tmp, tries to run it, and the kernel refuses. Root does not override noexec. The mount option wins.
Hence: ./getcomputerinfo: Permission denied.
The usual fix you find online is “set TMPDIR to a folder that allows exec”. So I did, and that is where the second failure came from.
Failure Two — TMPDIR Under /root Installs but Never Configures
The shell I was using had TMPDIR pointed at a folder under /root. That folder allows exec, so the first error went away. The package installed. It looked like success.
It was not. /root is private to root. The configurator step runs as veeam-usr-vspc-agent, which cannot read anything under /root. The symptoms:
auth_config.json: Permission deniedin the installer output, easy to miss in the scroll.- No
/etc/veeamma/config.cfgon disk. - The service shows
activating (auto-restart)and restarts every minute. - The log says “Load config failed” each time.
The package being installed is not the agent being configured. That one line is worth remembering.
Why Nobody Sees It in Testing
Most people test the agent on a clean lab VM. A fresh Ubuntu or RHEL install has /tmp on the root filesystem with exec allowed, and TMPDIR empty. The script works first time. The problem only appears on the server that matters — the hardened production box — and it appears as a permissions error, so the first guess is always “run it with sudo” or “the download is corrupt”.
There is a second reason. Many guides solve failure one and stop. They never reach failure two, because the install “succeeded”.
How to Actually Fix This
Step 1: Look before you change anything (read-only).
Check how /tmp is mounted.
findmnt -no OPTIONS /tmp
If the output contains noexec, the default temporary folder cannot run the installer’s helpers. Then check what your shell will use.
echo "$TMPDIR"
Empty means /tmp. A path under /root means failure two is waiting for you.
Step 2: Create a neutral temporary folder under /opt (changes state).
mkdir -m 755 /opt/veeamtmp
/opt sits on a filesystem that allows exec, and mode 755 lets the service user read it. That covers both conditions.
Step 3: Run the installer from there, with TMPDIR set (changes state).
cd /opt/veeamtmp && TMPDIR=/opt/veeamtmp bash <package>.sh
Put the company-specific package in that folder first. Setting TMPDIR on the same line means it applies to this one run and nothing else on the server changes.
If the installer says the same version is already installed — which it will, if failure two happened before — remove the half-configured package first, then run Step 3 again.
apt-get purge -y veeamma
Step 4: Verify. This step is where most tutorials stop and where mine starts.
systemctl status veeammaservice
You want active (running). If you see activating (auto-restart), the configurator did not finish — go back to Step 1 and check the folder again.
veeamconsoleconfig -s
You want the status Connected, and the connection account showing the customer’s company. If it shows a different company, you used the wrong package — the identity is in the file, not in a setting.
Step 5: Check that nothing else was removed.
Here’s the part that surprised me. Re-running a broken install script more than once can also remove the backup agent packages that were already on the box.
dpkg -l | grep veeam
If the backup agent packages are missing, push the backup agent again from the service-provider console. Do not assume it is still there because it was there an hour ago.
Step 6: Clean up.
rm -rf /opt/veeamtmp
The folder was only for the install. Leaving an exec-allowed temporary folder lying around undoes part of the hardening you just respected.
Better Still — Install Once, Push the Rest
The management agent has to go on by hand, once. After it reports Connected, I push the backup agent from the service-provider console instead of installing it by hand. The push travels over the existing cloud gateway connection, so it skips the whole manual chain:
- no repository package to download and no
NO_PUBKEYkey import, - no
TMPDIRworkaround for a second time, - no
needrestartprompt asking to restart Apache on a live production site.
That last one matters on cPanel. A prompt that restarts the web server in the middle of the business day is not a backup install. It is an outage with extra steps.
The Checklist I Run After Every Linux Agent Install
- Temporary folder —
findmnt -no OPTIONS /tmpbefore you start. If it saysnoexec, use the/optfolder from day one. - Service state —
systemctl status veeammaservicemust sayactive (running), notactivating. - Identity —
veeamconsoleconfig -smust show Connected and the right company. - Packages —
dpkg -l | grep veeammust still list the backup agent after any re-run. - Version match — the agent must not be newer than the backup server. A newer agent is rejected with “A newer version of the agent is not supported by the backup infrastructure”, and the console blocks the push.
- Licence edition — the agent needs a Server edition licence. With the free edition, the cloud destination simply does not appear in the job wizard.
- Provider registration — register the cloud provider from the command line with
veeamconfig cloud add. The wizard’s “Veeam Backup & Replication” option is a direct path on port 10006 and fails against a cloud gateway with “connection reset by peer”.
Plain takeaway: every one of these fails quietly. None of them stop the job wizard from opening.
What I Tell Every Customer Now
Before any agent goes on a hardened server, I ask one question:
“Is /tmp on this server mounted noexec, and do you want it to stay that way?”
If the answer is yes, they’re in good shape — we keep the hardening and install from /opt. If the answer is “I don’t know”, we’re not done yet. That is a server nobody has looked at closely, and the backup install will be the first thing to find out.
I write about the questions I ask in real customer rooms — the ones that change architectures and surface the problems no one else noticed. If you found this useful, drop your email below and I’ll send the next one when it’s ready.
FAQs
Why does the Veeam agent installer say Permission denied when I run it as root?
On cPanel servers /tmp is mounted noexec, and root cannot override a mount option. The installer unpacks helper binaries into the temporary folder and runs them from there, so the kernel refuses with “./getcomputerinfo: Permission denied”. Run the installer with TMPDIR pointed at a folder that allows exec, such as /opt/veeamtmp.
Why does veeammaservice keep restarting with “Load config failed”?
The package installed but the configuration step failed. This happens when TMPDIR points to a folder under /root: the configurator runs as the service user veeam-usr-vspc-agent, which cannot read /root, so /etc/veeamma/config.cfg is never written. Purge veeamma and reinstall with TMPDIR=/opt/veeamtmp in a folder with mode 755.
Should I remove noexec from /tmp to install the agent?
No. noexec on /tmp is useful hardening on a web server. Set TMPDIR for the one install command only, use a folder under /opt, and delete that folder when the agent reports Connected.
How do I check that the Veeam management agent is really working?
Run systemctl status veeammaservice and look for active (running), not activating (auto-restart). Then run veeamconsoleconfig -s and confirm the status is Connected and the connection account is the right company. Also run dpkg -l | grep veeam to make sure the backup agent packages are still installed.
Should I install the Veeam backup agent by hand on a cPanel server?
Install the management agent by hand once, then push the backup agent from the service-provider console. The push uses the existing gateway connection and avoids the repository key import, the TMPDIR workaround and the needrestart prompt that can restart Apache on a live server.