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

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.

Vishal Vyas [Linux Guru]

Welcome to Linux Guru! Hello, friends. My name is Vishal Vyas, and I am a DevOps engineer with expertise in Linux and Cloud Computing. I am also a Certified Kubernetes Administrator with over 12 years of experience in the IT field, working with various technologies. Through this blog, I aim to share my technical knowledge on Linux, AWS, DevOps, and web technologies. I will be posting about what I have learned from the latest web technologies and similar topics.


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

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

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

Previous Post Next Post