UBUNTU SAMBA MULTIUSER MULTIGROUP SHARE FOLDER WITH QUOTA
## Skip this step if you already upgraded apt-get update && apt-get upgrade && echo $?
apt-get install samba && echo $?
groupadd share
mkdir /share
chmod 3770 /share
chown root:share /share/
or
chgrp share /share
### Add IT group and directory
groupadd IT && mkdir /share/IT && chmod 3770 /share/IT && chgrp IT /share/IT/ && echo $?
useradd -d /share/IT/ -s /sbin/nologin -g share -G IT -M user1
smbpasswd -a user1
### nano /etc/samba/smb.conf
# add below lines at the end of file
## Skip this step if you already upgraded apt-get update && apt-get upgrade && echo $?
apt-get install samba && echo $?
groupadd share
mkdir /share
chmod 3770 /share
chown root:share /share/
or
chgrp share /share
### Add IT group and directory
groupadd IT && mkdir /share/IT && chmod 3770 /share/IT && chgrp IT /share/IT/ && echo $?
useradd -d /share/IT/ -s /sbin/nologin -g share -G IT -M user1
smbpasswd -a user1
### nano /etc/samba/smb.conf
# add below lines at the end of file
[share]
path = /share/
comment = samba share for company files
valid users = user1 user2 user3 user4
public = no
writable = yes
printable = no
create mask = 770
directory mask = 3750
force directory mode = 3750
inherit permissions = yes
## Restart the samba
service smb restart
Quota Configuration
## install quota
apt-get install quota
nano /etc/fstab
#add below line at the end
/dev/sda1 / ext4 errors=remount-ro,usrquota,grpquota 0 1
## Remount the file system
mount -o remount /
## it will set 5GB soft limit and 6GB hard limit
quotatool -u user1 -bq 5000Mb -l "6000 Mb" / -v
Now all you need is common sense....!
ReplyDeleteedquota user
ReplyDeletesoft hard
5120000 6144000
Ctrl+o
Ctrl+x
chmod 750 dir
ReplyDeletechown root:group dir
chmod 740 file