[Samba] Updating sambaLogonTime when user logs in

Carlos Eduardo Pedroza Santiviago carlos at prognus.com.br
Wed Jan 4 13:44:02 GMT 2006


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 at prognus.com.br>
	



More information about the samba mailing list