Monday, April 14, 2014

Samba configuration with quota

1)Samba Configuration :

RPM : samba , samba-common, samba-clientDaemon : smbdPORT : 136,137,138conf file : /etc/samba/smb.conf
#rpm -ivh samba-*.*

step1 :

#vi /etc/samba/smb.conf
copy last lines 265 to 272 and paste at the end of file .
275 [myshare] //show this name from windows . 276 comment = ashik and red 277 path = /shared 278 valid users = ashik red 279 public = no 280 writable = yes 281 printable = no 282 create mask = 0765
:wq
step 2:

#useradd ashik and red
#smbpasswd -a ashik;red
#service smb restart
#testparm /etc/samba/smb.conf //show all files which I have been shared in server.


From Linux Client :
* smbclient //192.168.0.244/shared -U ashik > ls >help
*smbclient -L 192.168.0.244 -U red

From windows :
go to run : //192.168.0.244
or,
ftp://192.168.0.244
or ,
from network neighbour .

2) Quota Configuration :


a)
[root@localhost home]# df -hFilesystem Size Used Avail Use% Mounted on/dev/hda8 9.1G 1.9G 6.8G 22% /tmpfs 1006M 0 1006M 0% /dev/shm/dev/hda9 3.9G 72M 3.6G 2% /home
b) umount /dev/hda9 /home
[root@server ~]# mkfs -t ext3 /dev/hda9mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)393216 inodes, 785169 blocks39258 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=80530636824 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912
Writing inode tables: done Creating journal (16384 blocks): doneWriting superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.

b)
cat /etc/fstab[root@localhost home]# cat /etc/fstab LABEL=/1 / ext3 defaults 1 1devpts /dev/pts devpts gid=5,mode=620 0 0tmpfs /dev/shm tmpfs defaults 0 0#LABEL=/home /home ext3 defaults 1 2/dev/hda9 /home ext3 defaults,usrquota 0 0proc /proc proc defaults 0 0sysfs /sys sysfs defaults 0 0LABEL=SWAP-hda10 swap swap defaults 0 0[root@localhost home]#
# mount -a# mount
c)
[root@server ~]# quotacheck -mc /home ; if problem ,restart server
[root@server ~]# quotacheck -mc /home[root@server ~]# quotaon -a [root@server ~]# useradd -d /home/pink pink ; smbpasswd -a pink
4)
[root@server ~]# chmod 777 /quota
[root@server ~]# edquota pinkDisk quotas for user pink (uid 502): Filesystem blocks soft hard inodes soft hard /dev/sdb1 0 5 10 0 0 0
5)
[root@server ~]# edquota -tGrace period before enforcing soft limits for users:Time units may be: days, hours, minutes, or seconds Filesystem Block grace period Inode grace period /dev/sdb1 7days 7days

From user end :


Login as Pink
#cd /quota

#touch file1

Note
The soft limit (soft =) specifies the maximum amount of disk usage a quota user is allowed to have. The hard limit (hard =) specifies the absolute limit on the disk usage a quota user can't go beyond it.

No comments:

Post a Comment