Jump to content

Recommended Posts

Posted

how do people deal with letting the users know what their quotas are? i've found various vb scripts but i'm limited because the user appears to need some permissions or our 2 users that have 10gb+ cause a problem with a vbs script that harvests through the quota entries server side.

 

I cant even get the status bar turned on en masse at the moment :'(

Posted

I'm using a Linux based file server for my user areas, but the method I use should work for Windows?

 

Basically cron runs a program that checks everyone's quota and emails them when they are close/over the soft limit or hit the hard limit.

 

I'd imagine you could cook up a VB script to be run from Scheduled Tasks from an Admin Account to do the same thing?

  • Thanks 1
Posted
I'm using a Linux based file server for my user areas, but the method I use should work for Windows?

 

Basically cron runs a program that checks everyone's quota and emails them when they are close/over the soft limit or hit the hard limit.

 

I'd imagine you could cook up a VB script to be run from Scheduled Tasks from an Admin Account to do the same thing?

 

the script i was using to do this broke on any account over 1 gig :(

Posted
I'm using a Linux based file server for my user areas, but the method I use should work for Windows?

 

Basically cron runs a program that checks everyone's quota and emails them when they are close/over the soft limit or hit the hard limit.

 

I'd imagine you could cook up a VB script to be run from Scheduled Tasks from an Admin Account to do the same thing?

 

sounds interesting. can you share the script please, I'd like to do something similar.

btw - how do you get the quotas setup for each user - does it have to be done individually ?

Posted (edited)
the script i was using to do this broke on any account over 1 gig :(

 

Post it in the scripts forum and see if anyone can spot the bug? :)

Edited by Geoff
Posted
sounds interesting. can you share the script please, I'd like to do something similar.

 

man warnquota

 

btw - how do you get the quotas setup for each user - does it have to be done individually ?

 

I should write a Samba File Server HOWTO. :)

  • Thanks 1
Posted (edited)

I recently put this together on RHEL5, with quotas (since geoffs post).

not sure if it works I guess I find out tomorrow as the kids are back ;)

 

feel free to fix anything

 

Configure ntp to get time from AD server

 

copy to /etc/krb5.conf

[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log

[libdefaults]
default_realm = X.COLLEGE.INTERNAL
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
forwardable = yes

[realms]
EXAMPLE.COM = {
 kdc = kerberos.example.com:88
 admin_server = kerberos.example.com:749
 default_domain = example.com
}

X.COLLEGE.INTERNAL = {
 kdc = server1.X.college.internal
 kdc = server2.X.college.internal
 kdc = server3.X.college.internal
}

[domain_realm]
.example.com = EXAMPLE.COM
example.com = EXAMPLE.COM

x.college.internal = X.COLLEGE.INTERNAL
.x.college.internal = X.COLLEGE.INTERNAL
[appdefaults]
pam = {
  debug = false
  ticket_lifetime = 36000
  renew_lifetime = 36000
  forwardable = true
  krb4_convert = false
}

copy to /etc/samba/smb.conf

[global]
workgroup = DOMAIN
realm = X.COLLEGE.INTERNAL
server string = server4
security = ADS
password server = server1.x.college.internal  server2.x.college.internal
passdb backend = tdbsam
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /sbin/nologin
cups options = raw
log file = /var/log/samba/log.%m	
winbind use default domain = yes
winbind enum users = yes
obey pam restrictions = yes
usershare allow guests = no	
ea support =yes
       acl compatibility = Auto
       store dos attributes = yes
map readonly = no
       map archive = no
       map system = no 	
invalid users = root 
msdfs root = no
socket options = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
acl map full control = false
       hide files = /aquota.*/ 	

[homes]
comment = Home Directories for %U
read only = No
browseable = yes
path = /home/%D/%G/%U
valid users = %D\%S
admin users = @"DOMAIN\domain^admins", administrator
comment = Home Directories
inherit acls = Yes
inherit permissions = yes
map acl inherit = Yes
       veto files = /*.bat/*.cmd/*.com/*.exe/*.vbs/*.msi/*.pif/*.reg/
root preexec = /usr/local/sbin/homedirperms.sh %U %G
nt acl support = no
hide unreadable = yes
recycle:repository = recycle-bin
recycle:keeptree = yes
recycle:touch = Yes
recycle:versions = Yes
recycle:exclude = ?~$*,~$*,*.tmp,*.temp,*.TMP
recycle:exclude_dir = /tmp,/temp,/cache
recycle:directory_mode = 0770
recycle:subdir_mode = 0770
hide files =  /recycle-bin/
	vfs objects = default_quota recycle
default_quota:	uid = 501

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No

[students]
comment = All Home Directories  -admin share
path = /home/DOMAIN
write list = @DOMAIN\domain^admins
read only = No
inherit permissions = Yes
inherit acls = Yes
inherit owner = Yes
map acl inherit = Yes
force unknown acl user = yes
acl check permissions = no
nt acl support = yes

[edit] autocreate homedirs

 

copy to /usr/local/sbin/homedirperms.sh and make executable

chmod u+x /usr/local/sbin/homedirperms.sh 

#!/bin/bash
#don't create drives other than yeargroup!
if [ "$2" = "08" -o "$2" = "07" -o "$2" = "06" -o "$2" = "05" -o "$2" = "04" -o "$2" = "03" -o "$2" = "02" -o "$2" = "00" ] ; then     
if [ ! -e /home/DOMAIN/$2/$1 ]; then
	mkdir -p  /home/DOMAIN/$2/$1
	chown $1:"domain admins" /home/DOMAIN/$2/$1
	chmod o-rwx /home/DOMAIN/$2/$1
	chmod g+rwxs /home/DOMAIN/$2/$1
	setfacl -m user:$1:rwx /home/DOMAIN/$2/$1
	setfacl -m group:teachers:r-x /home/DOMAIN/$2/$1 
	setfacl -m group:"domain admins":rwx /home/DOMAIN/$2/$1
	setquota -u $1 614400 716800 0 0 /home/DOMAIN/	                		
fi
fi
exit 0

 

 

[edit] enable ACL support

 

edit /etc/fstab

/dev/sdd1               /home/DOMAIN            ext3    acl,quota,user_xattr 1 2

[edit] Join Domain

 

do

net ads join -U administrator

enter administrator password:

 

 

[edit] Allow users access to filesystem

 

edit /etc/nsswitch.conf to contain:

passwd: compat winbind
group: compat winbind
shadow: compat

[edit] test domain

wbinfo -u

should display list of users

getent passwd

 

should display list of users

[edit] start servers

chkconfig winbind on

chkconfig smb  on

/etc/init.d/winbind start

/etc/init.d/smb start

Edited by CyberNerd
Posted

It's an interesting question actually. I know for a fact that if a user navigates to My Computer, right clicks their home drive and chooses Properties, it displays the whole server volume (which is useless information).

 

However (if memory serves me right), with quotas enabled, if you repeat the process it should accurately display how much space a user has.

Posted
thank you for the config files :) nice work there..... really love my workstation and its linked into ad time for some work on the NTLM squid ;D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...