# ClamAV permissions

**URL:** <https://rebornos.discourse.group/t/clamav-permissions/1373>\
**Category:** Issues & Assistance\
**Created:** [August 23, 2024, 10:46am UTC](https://rebornos.discourse.group/t/clamav-permissions/1373 "2024-08-23T10:46:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [August 23, 2024, 10:46am UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/1 "2024-08-23T10:46:46Z")

</div>

When I installed the OS I left ClamAV checked cause I figured this day and age even being on Linux better safe than sorry. Now every time I got to update it I have to give ownership of /var/lib/clamav/ to active user using Rootactions. I find this odd since I give ownership to the active user using the same method for /mnt/ before creating my folders in it for my secondary drives and partitions, and it never reverts the ownership. I’m assuming var is handled by the system than mnt is. That said how do I keep the system from reverting var’s permissions back so I don’t have to give the active user ownership every time ClamAV updates? Thanks

```auto
── 03:36:22 - Update ClamAV Database(FreshClam) ────────────────────────────────
ClamAV update process started at Fri Aug 23 03:36:22 2024
ERROR: Can't create temporary directory /var/lib/clamav/tmp.8f1e9794be
Hint: The database directory must be writable for UID 1000 or GID 1002
ERROR: Update failed.
ClamAV Databases failed: 
   0: Command failed: `/usr/bin/freshclam`
   1: `/usr/bin/freshclam` failed: exit status: 10

Location:
   src/steps/generic.rs:958
Retry? (y)es/(N)o/(s)hell/(q)uit

```

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [August 23, 2024, 6:22pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/2 "2024-08-23T18:22:10Z")

</div>

`freshclam` needs superuser access. However, you can enable and start the `clamav-freshclam.service` as superuser once, which runs every two hours or can overridden in `/etc/clamav/freshclam.conf`.

```sh
sudo systemctl enable --now clamav-freshclam.service

```

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [August 23, 2024, 7:21pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/4 "2024-08-23T19:21:21Z")

</div>

Thanks Service is now enabled.

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [August 24, 2024, 11:54am UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/6 "2024-08-24T11:54:18Z")

</div>

OK even with the service running I’m back to the below. I know it’s not a issue with systemd cause I have 6 other items that I did the below for and all are running fine.

```auto
sudo systemctl enanle --now snapd emby.server flaresolverr prowlarr radarr sonarr

```

```auto
Checking for plugin updates
Nothing to install / update

── 04:24:05 - Update ClamAV Database(FreshClam) ────────────────────────────────
ClamAV update process started at Sat Aug 24 04:24:05 2024
ERROR: Can't create temporary directory /var/lib/clamav/tmp.9a3c483e9d
Hint: The database directory must be writable for UID 1000 or GID 1002
ERROR: Update failed.
ClamAV Databases failed: 
   0: Command failed: `/usr/bin/freshclam`
   1: `/usr/bin/freshclam` failed: exit status: 10

Location:
   src/steps/generic.rs:958
Retry? (y)es/(N)o/(s)hell/(q)uit

```

> <https://github.com/Cisco-Talos/clamav/issues/1349>
>
> I just installed a fresh copy of RebornOS and all is great with the exception of… when ClamAV goes to update I have to navigate to /var/lib/clamav/ and use rootactions to give active user ownership. Then it will update without issue. Please see my thread on ReornOS's forum. thanks
> 
> ClamAV 1.3.1-1
> Reborn OS with KDE Plasma 6.1.4
> 
> https://rebornos.discourse.group/t/clamav-permissions/1373/5

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [August 24, 2024, 12:45pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/7 "2024-08-24T12:45:46Z")

</div>

You may have modified permissions. You can uninstall and reinstall clamav and re-enable the service

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [August 24, 2024, 1:54pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/8 "2024-08-24T13:54:39Z")

</div>

That’s what I was thinking uninstall, delete the /var/liv/clamav/ folder, reboot, reinstall, and re-enable the service.

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [August 24, 2024, 3:42pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/9 "2024-08-24T15:42:55Z")

</div>

LOL well that only made it worse. Good idea would of figured on it working. Guess will have to wait to see if the dev for ClamAV weighs in.

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [August 24, 2024, 3:46pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/10 "2024-08-24T15:46:48Z")

</div>

```sh
sudo systemctl stop clamav-freshclam.service

sudo systemctl disable clamav-freshclam.service

sudo systemctl stop clamav-daemon.service

sudo systemctl disable clamav-daemon.service

```

```sj
sudo pacman -Rns clamav

```

```sh
sudo pacman -Syu clamav

sudo systemctl enable --now clamav-daemon.service

sudo systemctl enable --now clamav-freshclam.service

```

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [August 24, 2024, 5:24pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/11 "2024-08-24T17:24:08Z")

</div>

OK still no love. I went ahead and just on that folder after that didn’t work did sudo chmod 777 /var/lib/clamav/. Worked, but will know for sure tomorrow when I do updates again if it keeps working.

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [August 25, 2024, 10:08am UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/12 "2024-08-25T10:08:07Z")

</div>

OK looks like chmod isn’t the answer either.

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [August 25, 2024, 4:30pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/13 "2024-08-25T16:30:41Z")

</div>

What was the problem with a clean reinstall?

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [August 25, 2024, 6:43pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/14 "2024-08-25T18:43:20Z")

</div>

Same issue as above.

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [September 4, 2024, 9:14am UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/15 "2024-09-04T09:14:21Z")

</div>

Since nothing seems to be working what command would I use to give myself ownership of that folder? I’m thinking that when I do updates I need ownership of the folder for updates to finish without hanging so I would create a ZSH alias for that command and Topgrade to run together.

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [September 4, 2024, 11:18am UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/16 "2024-09-04T11:18:21Z")

</div>

Cleanly install it. `freshclam` requires superuser privileges. The alternative is to enable the systemd service. If the service fails with permission issues, it must be reported upstream as a bug.

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [September 4, 2024, 12:47pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/17 "2024-09-04T12:47:31Z")

</div>

YES YES YES

`sudo chown UID:GID /var/lib/clamav && chmod 755 /var/lib/clamav`

Worked like a charm.

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [September 7, 2024, 9:44am UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/18 "2024-09-07T09:44:00Z")

</div>

That ended up not being the solution after all see the post in my issue thread on github. This version of ClamAV is written wrong.

> <https://github.com/Cisco-Talos/clamav/issues/1349>
>
> I just installed a fresh copy of RebornOS and all is great with the exception of… when ClamAV goes to update I have to navigate to /var/lib/clamav/ and use rootactions to give active user ownership. Then it will update without issue. Please see my thread on ReornOS's forum. thanks
> 
> ClamAV 1.3.1-1
> Reborn OS with KDE Plasma 6.1.4
> 
> https://rebornos.discourse.group/t/clamav-permissions/1373/5

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [September 7, 2024, 1:27pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/19 "2024-09-07T13:27:29Z")

</div>

The Arch package’s issue tracker seems to be here: [Issues · Arch Linux / Packaging / Packages / clamav · GitLab](https://gitlab.archlinux.org/archlinux/packaging/packages/clamav/-/issues)

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [September 7, 2024, 5:06pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/20 "2024-09-07T17:06:24Z")

</div>

Yea maybe I send them a detailed email so they create an account for me and I can report it to them. This is their version of ClamAV, right? I ask cause I always thought the Extra repo was KDE’s. Thanks

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [September 7, 2024, 5:08pm UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/21 "2024-09-07T17:08:41Z")

</div>

Arch Linux takes ClamAV’s code or binaries and packages the files to be later used by the Arch Linux package management system. This repository contains what Arch Linux maintainers use to create the package for you.

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [September 8, 2024, 10:56am UTC](https://rebornos.discourse.group/t/clamav-permissions/1373/22 "2024-09-08T10:56:28Z")

</div>

See the last post it’s seems to have fixed the issue.

> **[ClamAV permissions](https://forum.garudalinux.org/t/clamav-permissions/39087)**
>
> I installed ClamAv and ClamTK as an extra security measure, however every time I go to update it I have to give ownership of /var/lib/clamav/ to active user using Rootactions. I find this odd since I give ownership to the active user using the...

[Next page](https://rebornos.discourse.group/t/clamav-permissions/1373.md?page=2)
