Block certain file extensions on samba linux

Block certain file extensions on samba Linux

Configuring Samba Server 

Samba is a free and open-source protocol for server message blocks (SMB) that offers File and print services are provided to clients using various systems.You can share files and folders over a network in Linux by using the samba server if you are using a Samba server in your organization and wish to prevent some file types from being uploaded to a shared directory. In Samba, you can use veto files to prevent certain file types from being opened. It does not allow you to upload mp3, exe, or any other file types. In this In this article, I'll show you how to use a veto file to block specific files in the samba server in Linux.

Open the samba config file and add the veto file to the last line of your shared block.

vim /etc/samba/smb.conf


[Vishal]
comment = vishalvyas
Path = /home/vishal
public = yes
writable = yes
browseable = yes
read only = no
valid user = vishal
create mask = 0775
Veto files = /*.exe/*.com/*.dll/*.bat/*.vbs/*.tmp/*.mp3/*.avi/*.mp4/*.wmv/*.wma/


Users can now upload any type of file except those listed in the veto files section.

Linux Guru

Welcome to my Linux blog! Hello Friends, I am Vishal Vyas. I am a DevOps engineer and expert in Linux and Cloud Computing. Also I am a Certified Kubernetes Administrator, I have a total 12 plus years of experience in the IT field and I have worked in various technologies. I write about Linux, AWS, DevOps and web Technologies, I have started this blog to share my technical knowledge with all, I am posting here what I learn from the latest web technologies and the likes.

4 Comments

If you have any doubts, Please let me know


  1. That is very interesting; you are a very skilled blogger. I have shared your website in my social networks..!


    Informatica Training in Chennai

    ReplyDelete
  2. how if i want just one files type allowed on samba share

    ReplyDelete
  3. I am using samba server and shares are mapped in windows. Will veto files restrict from copying files from windows samba share

    ReplyDelete
Previous Post Next Post