Thursday, May 24, 2012

SAMBA WITH USER QUOTA

Install packages samba and quotatool yum install samba quotatool
2. Make a samba group
sudo groupadd samba
::::::::::::::::::::::    change default home by edit /etc/default/useradd         to /smbbakcup
3. Add users
useradd oppilas
4. Add user to the samba group
sudo adduser :user: smb
An example:
sudo adduser oppilas smb
5. Anna a password for user
smbpasswd -a :user:
An example:
smbpasswd -a oppilas
6. Backup /etc/samba/smb.conf
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old
7. Edit sambaconf file between Share Definions ?
vi /etc/samba/smb.conf
An example:
[Oppilas]
comment = oppilas
path = /smbbackup
browseable = yes
writeable = yes
create mask = 0777
directory mask = 0777
8. Restart samba
sudo service smbd restart
9. Give the rights
An example: oppilas at /smbbackup/oppilas

Userquota
1. Edit /etc/fstab file by adding a stanza ,usrquota
An example home folder on the partition /dev/sda8
/dev/sda8 /home ext3 defaults,usrquota 0 0
2. reboot (or sudo mount -a)
3. Set the restriction as userquota
An example for user oppilas 250MB space
sudo setquota -u oppilas 204800 256000 0 0 /smbbackup+


setquota -u khadar 500 600 0 0 /smbbackup

now khadar can use data with in quota limit..

No comments:

Post a Comment