[Samba] Ldapscripts v1.4 is out

ganael.laplanche ganael.laplanche at martymac.com
Sat Jan 7 11:28:46 GMT 2006

Hello all,

And now a small advert ;-)

I'm pleased to announce the v 1.4 of the ldapscripts.

The ldapscripts are shell scripts provided under the terms of the GPL license.

They allow to manage POSIX accounts (users, groups, machines) in an LDAP
directory. They can be used on GNU/Linux and FreeBSD (and any other Unix-like
?). They are similar to the smbldap-tools but are written in sh, not in PERL.
They only require OpenLDAP client commands (ldapadd, ldapdelete, ldapsearch,
ldapmodify, ldapmodrdn, ldappasswd) and make the administrator's work a lot
easier avoiding him to configure PERL and each library dependencies (e.g.
Net::LDAP). They only manage POSIX accounts ; Samba accounts information is to
be added afterwards by Samba commands.

The scripts may be used independently - in command lines - or automatically by
Samba, to handle POSIX information within accounts before adding Samba
information (e.g. during a net vampire). Here is a small example showing how to
use the scripts in the smb.conf file :

add machine script = /usr/local/bin/ldapaddmachine '%u' sambamachines
add user script = /usr/local/bin/ldapadduser '%u' sambausers
add group script = /usr/local/bin/ldapaddgroup '%g'
add user to group script = /usr/local/bin/ldapaddusertogroup '%u' '%g'
delete user script = /usr/local/bin/ldapdeleteuser '%u'
delete group script = /usr/local/bin/ldapdeletegroup '%g'
delete user from group script = /usr/local/bin/ldapdeleteuserfromgroup '%u' '%g'
set primary group script = /usr/local/bin/ldapsetprimarygroup '%u' '%g'
rename user script = /usr/local/bin/ldaprenameuser '%uold' '%unew'

Here is the changelog :

2006/01/05 : ldapscripts 1.4
 - More code cleaning !!! Code now clean... (and bug-free ???) - thanks to
Madcoder for the help he provided !
 - Removed dependency to slappasswd !!! Using ldappasswd instead (included in
the standard ldap-client commands)
 - Added new ldaprenameuser command (uses ldapmodrdn included in the standard
ldap-client commands)
     Add this to Samba 3.0.21's configuration file : rename user script =
ldaprenameuser '%uold' '%unew'
     Warning : renaming an entry (user/group/machine) only involves renaming
its RDN !
     This means may have to change manually the account's homedir (user) and
modify each group to include the new
     rdn (user/machine) as a memberuid.
 - Also added useful _ldaprenamegroup and _ldaprenamemachine scripts (not used
by Samba)
 - A user/machine is now searched using its uid (no more use of its cn)
 - Full command now shown in logs
 - Modified README
 - New TODO file
 - Man pages (section 1 for each script, section 5 for a global "ldapscripts"

You can download them on http://contribs.martymac.com or

They are available as .tgz (all platform), .rpm (Mandriva), .deb (1.3 only at
the moment), and as a port on FreeBSD (1.3 only at the moment, see
/usr/ports/net/ldapscripts and http://www.freshports.org/net/ldapscripts).

Any feedback welcome :)

ganael.laplanche at martymac.com
Tel : (+33)

More information about the samba mailing list