Page 1 of 1

Installing Sophos

Posted: Wed Oct 18, 2023 12:14 pm
by john.hansen
Hi,

I'm fairly new to using Nagios and Linux in general so this may be an easy one for some of you.

We need to install Sophos on our Linux Server running Nagios Core 4.4.7 and the installer keeps failing because "/tmp is mounted to a partition with noexec." I understand that but any command to re mount /tmp as exec does not work. Does the whole partition need to be mounted as exec?

At this point, I don't want to throw commands at it in case I screw something up.

Any help is appreciated.

Thank you

Re: Installing Sophos

Posted: Wed Oct 25, 2023 3:59 pm
by bbahn
Hello john.hansen,

If /tmp is part of the root filesystem you would indeed need to remount the entire root filesystem, which is not recommended for security concerns. There are also a few other issues that it could be relating to things like filesystem-specific limitations and SELinux.

You can check the mount status with

Code: Select all

mount | grep /tmp
If this shows that /tmp is set to noexec then you will be unable to execute from there without remounting the root filesystem as exec, which you should not do.

As a workaround for this, you can try the following:
  1. create a new temporary directory from which to run the installation

    Code: Select all

    sudo mkdir /mytmp
  2. Export the TMPDIR environment variable to point to your new directory

    Code: Select all

    export TMPDIR=/mytmp
  3. Run the Sophos installer, which should now be using your temporary directory instead of /tmp
  4. Remove the temporary directory (I am not familiar with Sophos and you may need to skip this step)

    Code: Select all

    sudo rm -rf /mytmp
  5. And it's always a good idea to reset custom variables, even if you don't plan on maintaining the session for an extended period

    Code: Select all

    unset TMPDIR

Re: Installing Sophos

Posted: Mon Oct 30, 2023 3:35 pm
by john.hansen
Thank you bbahn!!

That did the trick. Have a great week!