Samba + Clamd + Samba-Vscan su CentOS 5.2

Eccovi qui un semplice tutorial su come preparare una macchina linux CentOS con Samba + Clamd e Samba-Vscan.

Prima di tutto creiamo il file per sfruttare il repo:

dag.repo in /etc/yum.repos.d/

Con all’interno:

[dag] name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag/
gpgcheck=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
enabled=1

2. Installiamo e configuriamo clamd:

yum install clamd.i386
vi /etc/clamd.conf

cambiamo il socket in /var/run/clamav/clamd.sock.

3. Aggiorniamo clamd:

freshclam



4. Attiviamo al boot clamd

chkconfig clamd on
service clamd start

5. creiamo la cartella per i virus in quarantena:

mkdir /virus


6. Installiamo i sorgenti di samba:

wget http://mirror.cs.vt.edu/pub/CentOS/5/updates/SRPMS/samba-3.0.28-1.el5_2.1.src.rpm
rpm -ihv samba-3.0.28-1.el5_2.1.src.rpm

7. Extract samba file in /usr/src/redhat/SOURCES:

cd /usr/src/redhat/SOURCES
tar xzvf samba-3-0.28.tar.gz

8. Run ./configure.

cd /usr/src/redhat/SOURCES/samba-3.0.28/sources
./configure
make proto

9. Get samba vscan release 0.3.6cBeta5 if you are using samba3.0.25 or later.

wget http://www.openantivirus.org/download/samba-vscan-0.3.6c-beta5.tar.gz


10. Extract samba-vscan tarball.

tar xzvf samba-vscan-0.3.6c-beta5.tar.gz
cd /usr/src/redhat/SOURCES/samba-3.0.28/examples/VFS/samba-vscan-0.3.6c-beta5/


11. Make backend for clamav:

make clamav

12. Copia vscan-clamav.so.

cp vscan-clamav.so /usr/lib/samba/vfs/

13. Copia vscan fileconf in samba dir.

cp clamav/vscan-clamav.conf /etc/samba/

14. Edit /etc/samba/vscan-clamav.conf verifica il clamd socket = /var/run/clamav/clamd.sock:

vi /etc/samba/vscan-clamav.conf
vfs object = vscan-clamav vscan-clamav: config-file = /etc/samba/vscan-clamav.conf





0