F
F
fokin_nikolay19892018-07-04 15:15:56
linux
fokin_nikolay1989, 2018-07-04 15:15:56

How to block files in samba share?

Good afternoon, tell me how to prohibit the introduction of files of any extensions and names except for certain extensions? mine looks like this, but all files are hidden and allowed extensions cannot be backed up

[global]
         guest ok = yes
         guest account = nobody
         security = share
         unix charset = utf8
         dos charset = cp1251
        display charset = cp1251
        log level = 0 vfs:2
        max log size = 0
        syslog = 0
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
     read size = 32768
     read raw = no
     read prediction = true
     write raw = yes
     wide links = no
     oplocks = yes
     max xmit = 65535
     dead time = 15
     getwd cache = yes
     lpq cache = 30
     level2 oplocks = true


[rezerv]
comment = rezerv
path = /home/obmen
guest ok = yes
writable = yes
public = yes
browseable = yes
create mask = 0777
force create mode = 0777
directory mask = 0777
force directory mode = 0777
force user = nobody
force group = nobody
kernel oplocks = yes
level2 oplocks = no
veto oplock files = /*.odt/*.doc/*.docx/*.xls/*.xlsx/*.png/*.gif/*.jpeg/*.jpg/*.ods/*.csv/*.pdf/*.xml/
veto files = /*.a*/*.A*/*.b*/*.B*/*.c*/*.C*/*.D*/*.d*/*.E*/*.e*/*.F*/*.f*/*.G*/*.g*/*.H*/*.h*/*.I*/*.i*/*.J*/*.j*/*.K*/*.k*/*.L*/*.l*/*.N*/*.n*/*.O*/*.P*/*.p*/*.Q*/*.q*/*.R*/*.r*/*.S*/*.s*/*.T*/*.t*/*.U*/*.u*/*.Y*/*.y*/*.V*/*.v*/*.X*/*.$

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2018-07-04
@Zarom

It's obvious why you're using veto oplock files - it doesn't work as you describe.
Try veto files = /!*.docx/
In theory, this will ban all files except docx. If this design does not work, then the desired result cannot be achieved through the samba config.
The workaround is a cron script that removes forbidden files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question