Virusscanning on samba shares?

Discussion in 'Suggest HOWTO' started by HoUsECAt, Apr 14, 2006.

  1. HoUsECAt

    HoUsECAt New Member

    Perhaps add a possibilty to add virusscan the samba shares to the tutorial from Small Business Samba Server on Ubuntu?
     
  2. sbovisjb1

    sbovisjb1 Member HowtoForge Supporter

  3. HoUsECAt

    HoUsECAt New Member

    is it also possible to configure an instant virus-scanner? instead of a cron-job?
     
  4. thctlo

    thctlo New Member

    on access virus scanner and recyle bin for samba.

    yes this is possible,

    check out this link
    this is my work, its not perfect, but you get far with this.
    /snap

    8.0 On-Access virus scanning on samba (samba-clamav)
    8.1 Installing ClamAV

    apt-get install clamav arj unzoo lha clamav-freshclam clamav-daemon
    Configuring clamav-freshclam : Daemon
    Choose a close mirror
    Should clamd be notified after updates? Yes
    8.2 get the sources ( samba & samba-vscan )

    mkdir /usr/src/sources
    cd /usr/src/sources

    apt-get install dpkg-dev
    apt-get source samba
    apt-get build-dep samba

    cd samba-3.0-14a
    vi source/include/version.h

    here remove the a from the 14 ( 3.0.14a => 3.0.14 )

    ./debian/rules configure-stamp
    cd source
    ./make proto
    cd ../..

    wget
    http://switch.dl.sourceforge.net/sourceforge/openantivirus/samba-vscan-0.3.6
    b.tar.bz2

    tar xjvf samba-vscan-0.3.6b.tar.bz2

    cd samba-vscan-0.3.6b
    ./configure
    --with-samba-source=/usr/src/sources/samba-3.0.14a/source
    make && make install

    cp clamav/vscan-clamav.conf /etc/samba/samba-vscan-clamav.conf
    change in the samba-vscan-clamav.conf
    clamd socket name = /var/run/clamav/clamd.ctl
    infected spins action = quarantine ( or delete , which I choose.)

    When I put that lines in my smb.conf file, I can't access the share
    :
    vfs object = vscan-clamav
    vscan-clamav: config-file = /etc/samba/samba-vscan-clamav.conf

    An example:
    [public]
    comment = Public Directory
    path = /home/public
    vfs object = vscan-clamav
    vscan-clamav: config-file = /etc/samba/samba-vscan-clamav.conf

    !!! BEWARE !!!! if samba upgrade to a higer version you MUST
    recompile
    your samba-vscan. set samba to hold for no upgrade.

    echo packagename hold | dpkg --set-selections set to hold
    echo packagename install | dpkg --set-selections set to install
    9.0 Recycle bin on samba
    9.1 Recycle bin configuration

    configure samba for using the recycle bin.
    I made my manager happy with this.

    create a file in /etc/samba
    and fill it with the options below.

    /etc/samba/samba-recycle.conf

    name = .recycle
    mode = KEEP_DIRECTORIES|VERSIONS|TOUCH
    maxsize = 0
    exclude = *.tmp|*.temp|*.o|*.obj|~$*|*.~??|~*.tmp
    excludedir = /tmp|/temp|/cache
    noversions = *.doc|*.xls|*.ppt

    add this to you share, same as vscan.

    vfs object = recycle
    recycle: config-files = /etc/samba/samba-recycle.conf

    create a recycle bin directorie and hide it for the users.

    I created .recycle this way ( because of the dot) users don't see
    this
    IF.. you don't set you explorer to view hidden files.

    restart samba and your done.

    You are ready to use your samba server.

    greets,

    Louis
     
  5. aaron1234nz

    aaron1234nz New Member

    One more step

    If you are experiencing problems where your samba shares don't show up when the vfs object is enabled, it is most likely it is because there is one more thing you need to to make it work, which was missed out is this howto.

    cp /usr/src/samba-vscan-0.3.6b/vscan-clamav.so /usr/lib/samba/vfs/
     
  6. invitation

    invitation New Member

    is it also possible to configure an instant virus-scanner? instead of a cron-job?

    yes this is possible,

    check out this link (http://lists.samba.org/archive/samba/2005-December/114817.html)
    this is my work, its not perfect, but you get far with this.
    /snap

    8.0 On-Access virus scanning on samba (samba-clamav)
    8.1 Installing ClamAV

    apt-get install clamav arj unzoo lha clamav-freshclam clamav-daemon
    Configuring clamav-freshclam : Daemon
    Choose a close mirror
    Should clamd be notified after updates? Yes
    8.2 get the sources ( samba & samba-vscan )

    mkdir /usr/src/sources
    cd /usr/src/sources

    apt-get install dpkg-dev
    apt-get source samba
    apt-get build-dep samba

    cd samba-3.0-14a
    vi source/include/version.h

    here remove the a from the 14 ( 3.0.14a => 3.0.14 )

    ./debian/rules configure-stamp
    cd source
    ./make proto
    cd ../..

    wget
    http://switch.dl.sourceforge.net/sourceforge/openantivirus/samba-vscan-0.3.6
    b.tar.bz2

    tar xjvf samba-vscan-0.3.6b.tar.bz2

    cd samba-vscan-0.3.6b
    ./configure
    --with-samba-source=/usr/src/sources/samba-3.0.14a/source
    make && make install

    cp clamav/vscan-clamav.conf /etc/samba/samba-vscan-clamav.conf
    change in the samba-vscan-clamav.conf
    clamd socket name = /var/run/clamav/clamd.ctl
    infected spins action = quarantine ( or delete , which I choose.)

    When I put that lines in my smb.conf file, I can't access the share
    :
    vfs object = vscan-clamav
    vscan-clamav: config-file = /etc/samba/samba-vscan-clamav.conf

    An example:
    [public]
    comment = Public Directory
    path = /home/public
    vfs object = vscan-clamav
    vscan-clamav: config-file = /etc/samba/samba-vscan-clamav.conf

    !!! BEWARE !!!! if samba upgrade to a higer version you MUST
    recompile
    your samba-vscan. set samba to hold for no upgrade.

    echo packagename hold | dpkg --set-selections set to hold
    echo packagename install | dpkg --set-selections set to install
    9.0 Recycle bin on samba
    9.1 Recycle bin configuration

    configure samba for using the recycle bin.
    I made my manager happy with this.

    create a file in /etc/samba
    and fill it with the options below.

    /etc/samba/samba-recycle.conf

    name = .recycle
    mode = KEEP_DIRECTORIES|VERSIONS|TOUCH
    maxsize = 0
    exclude = *.tmp|*.temp|*.o|*.obj|~$*|*.~??|~*.tmp
    excludedir = /tmp|/temp|/cache
    noversions = *.doc|*.xls|*.ppt

    add this to you share, same as vscan.

    vfs object = recycle
    recycle: config-files = /etc/samba/samba-recycle.conf

    create a recycle bin directorie and hide it for the users.

    I created .recycle this way ( because of the dot) users don't see
    this
    IF.. you don't set you explorer to view hidden files.

    restart samba and your done.

    You are ready to use your samba server.
     
  7. rockstar9840

    rockstar9840 New Member

    Hey invitation, you describe the process so clearly and nicely. I easily got it. You really help me a lot.

    Thank You :)
     
  8. jhonhud

    jhonhud New Member

    Hi...Your post really got me thinking man..... an intelligent piece I must say. :)
     
  9. flyingjohn

    flyingjohn New Member

    nice code above :)
     

Share This Page