File size limit in CIFS

Status
Not open for further replies.

Keetawat

Dabbler
Joined
Jan 4, 2017
Messages
11
Dear All,
I have some question that FreeNAS can limit file size when users put file into the shared folder.
Please advise.

Thank you in advance.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
I don't think that's possible at the protocol level for SMB. You can set quotas ZFS datasets that limits the total size of the dataset, but not the individual files.
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
There's a couple of ways to do this with quotas that I saw just skimming a few pages on a search for "samba restrict file size"

Specifically, you can edit /etc/login.conf (or use racct / rctl) to impose filesize limits: https://www.freebsd.org/doc/handbook/security-resourcelimits.html
The problem with this approach is that it will most likely not persist across reboots, which means creating an init script to impose a filesize limit on the group of users.
 
Last edited:

Keetawat

Dabbler
Joined
Jan 4, 2017
Messages
11
Dear All,
Thank you for your replied. I could not found the "/etc/security/limits.conf" and also I use the CIFS service.
So the solution could not be done, please advise.
Thank you.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Dear All,
Thank you for your replied. I could not found the "/etc/security/limits.conf" and also I use the CIFS service.
So the solution could not be done, please advise.
Thank you.

Well, after looking at it a bit closer, I don't think that using racct / rctl as a way of limiting size of files copied by samba is practical. I'm a bit curious, why do you need to do this?
 
Status
Not open for further replies.
Top