22

Samba+quota限制共享目录容量-熊二的日常的博客

 4 years ago
source link: https://blog.51cto.com/9605182/2493194
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Samba+quota限制共享目录容量

前言:此处只针对xfs文件系统

1、编辑挂载文件 vi /etc/fstab,修改需要进行磁盘限额的挂载点,在defualt后面加入usrquota,grpquota

image.png

2、使用 mount -a重新挂载,然后查看mount | grep grpquota,如目标分区出现红框标识内容则说明修改成功

image.png

3、给用户限额(此处只限制软容量和硬容量,不限制文件数)例如:xfs_quota -x -c "limit -u  bsoft=20g bhard=20g sxh" /home

image.png

image.png

(1)-u 表示给用户限额,bsoft和bhard分别为软容量和硬容量

(2)-g 表示给用户组限额

(3)sxh 这个是用户,根据实际情况写就ok

(4)/home 挂载点,就是你要限额的分区挂载目录

4、配置samba

image.png

(1)path:linux上需要共享的目录

(2)write list :谁有权限写入,对个用逗号分隔

5、重启samba服务,systemctl restart smb

©著作权归作者所有:来自51CTO博客作者熊二的日常的原创作品,如需转载,请注明出处,否则将追究法律责任

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK