Set file type to upload in SMB

New to the forum? Introduce yourself, chit chat and chew the fat.
riaj uddin
Posts: 8
youtube meble na wymiar Warszawa
Joined: Tue Oct 31, 2023 2:57 pm

Set file type to upload in SMB

Post by riaj uddin »

I am new in Asustor NAS. I need to restrict users for uploading file in NAS by file type like I do not want user to upload exe files. Is there any solution to set this?

Thanks in advance!
User avatar
Nazar78
Posts: 2235
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore

Re: Set file type to upload in SMB

Post by Nazar78 »

Not officially supported but a hint, veto files.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
riaj uddin
Posts: 8
Joined: Tue Oct 31, 2023 2:57 pm

Re: Set file type to upload in SMB

Post by riaj uddin »

Nazar78 wrote:Not officially supported but a hint, veto files.
Thank you! But can you please explain the veto files, how can I use this?
User avatar
father.mande
Posts: 2219
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: Set file type to upload in SMB

Post by father.mande »

Hi,
SMB (smb.conf) official documentation
veto files (S)
This is a list of files and directories that are neither visible nor accessible. Each entry in the list must be separated by a '/', which allows spaces to be included in the entry. '*' and '?' can be used to specify multiple files or directories as in DOS wildcards.

Each entry must be a unix path, not a DOS path and must not include the unix directory separator '/'.

Note that the case sensitive option is applicable in vetoing files.

One feature of the veto files parameter that it is important to be aware of is Samba's behaviour when trying to delete a directory. If a directory that is to be deleted contains nothing but veto files this deletion will fail unless you also set the delete veto files parameter to yes.

Setting this parameter will affect the performance of Samba, as it will be forced to check all files and directories for a match as they are scanned.

Examples of use include:

; Veto any files containing the word Security,
; any ending in .tmp, and any directory containing the
; word root.
veto files = /*Security*/*.tmp/*root*/

; Veto the Apple specific files that a NetAtalk server
; creates.
veto files = /.AppleDouble/.bin/.AppleDesktop/Network Trash Folder/
Default: veto files = # No files or directories are vetoed
Philippe.
Asustor updated :D to ADM 5.0
FS6706T / AS3302Tv2 / AS5202T / AS6602T
Asustor E.O.L. at A.D.M. 4.0 :(
AS5002T / AS1002T
Asustor past :mrgreen:
AS202T