Carlos Eduardo Pedroza Santiviago
2006-Jan-04 13:44 UTC
[Samba] Updating sambaLogonTime when user logs in
Hi, I've made a quick and dirty Samba config. to update the sambaLogonTime timestamp when user logs in (LDAP backend). Here, i have an specific share that all users connect when they log in, besides the netlogon. However i think you can use the netlogon to modify it too (maybe add some verification in case of "Guest" connects, which is left to you). Basically, you have to add: [netlogon] ... root preexec = /usr/bin/updateLogonTime.sh "%u" ... And updateLogonTime.sh: __BEGIN__ #!/bin/bash TIMESTAMP=$(date +%s) /usr/bin/ldapctl YOURDOMAIN replace $1 sambaLogonTime "$TIMESTAMP" __EOF__ Easy, huh? ldapctl is a fucking awesome tool i found while surfing around. You can grab it here: http://sneakymustard.com/blog/code/python/ldapctl.shtml In some organizations, the sambaLogonTime is required to met their policy. Of course, other modifications could be done as well. cya, -- Carlos Eduardo Pedroza Santiviago - <carlos@prognus.com.br>