LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Permissions for clamdscan (http://www.linuxquestions.org/questions/linux-software-2/permissions-for-clamdscan-906389/)

nebulein 10-04-2011 10:36 AM

Permissions for clamdscan
 
Hi,

I am currently trying to set up virus scanning with clamav on my mail server.
I am retrieving the mails for each user seperately with getmail and handling them with procmail and spamassassin. Works fine so far.

No I have installed clamav, configured it and started clamd. It seems to work. The only problem is, that I obviously only can scan files with clamdscan as root. When trying to scan a file as a user I get the following:

Code:

[ben@hermes~]$ clamdscan test.txt
ERROR: Can't connect to clamd: Permission denied

----------- SCAN SUMMARY -----------
Infected files: 0
Total errors: 1
Time: 0.000 sec (0 m 0 s)

(Obviously I also get permission denied when calling clamdscan from procmail, the problem does not seem to be procmail.)
I have read the documentation for clamav and searched the web for quite a while but without any solution. What do I do wrong? I guess I just need user access to clamd.

And, btw. I am quite happy with my mail setup and doing excessive filtering with procmail. That means I don't want to replace it by something else. :-)

OS is Slackware 13.37, Procmail 3.22, Clamav 0.97.2

Any help would be appreciated.


Ben

SL00b 10-04-2011 11:01 AM

You're running clamdscan as yourself, which would connect to clamd in order to run the scan. What userid are you running clamd under?

Typically you start clamd under root authority, but set it to run under a service account with a setting in /etc/clamd.conf.

nebulein 10-04-2011 01:23 PM

Thanks for the quick reply.

clamd is started as root and running under clamav. And clamdscan runs as a normal user. (e.g. myself)

SL00b 10-04-2011 04:07 PM

Quote:

Originally Posted by nebulein (Post 4489937)
Thanks for the quick reply.

clamd is started as root and running under clamav. And clamdscan runs as a normal user. (e.g. myself)

That's a typical configuration.

So it seems the solution should be to run clamdscan as clamav. Give yourself sudo access to run the clamdscan command as user clamav, and you should be good to go.

nebulein 10-06-2011 07:34 AM

Thanks, it works with sudo.


All times are GMT -5. The time now is 06:51 PM.