Release: | |
Reference: | |
Publication date: | |
Print date: | April 22, 2008 |
rpm -Uvh smbldap-tools-0.9.3-1.i386.rpm
mkdir /etc/smbldap-tools/ cp *.conf /etc//smbldap-tools/ cp smbldap-* /usr/sbin/The configuration is now based on two differents files:
chmod 644 /etc/smbldap-tools/smbldap.conf chmod 600 /etc/smbldap-tools/smbldap_bind.conf
/usr/share/doc/smbldap-tools-0.9.3/configure.plIt will ask for the default values defined in your smb.conf file, and will update the two configuration files used by the scripts. Samba configuration file should then be already configured. Note that you can stop the script at any moment with the Crtl-c keys.
key="value"Full example configuration files can be found at 8.1.
|
|
In the more general case, to set up your directory, simply use the following command:
option definition default value -u uidNumber first uidNumber to allocate 1000 -g gidNumber first uidNumber to allocate 1000 -a user administrator login name Administrator -b user guest login name nobody -e file export a init file -i file import a init file
Table 1: Options available for the smbldap-populate script
[root@etoile root]# smbldap-populate Using builtin directory structure adding new entry: dc=example,dc=com adding new entry: ou=Users,dc=example,dc=com adding new entry: ou=Groups,dc=example,dc=com adding new entry: ou=Computers,dc=example,dc=com adding new entry: ou=Idmap,dc=example,dc=org adding new entry: cn=NextFreeUnixId,dc=example,dc=org adding new entry: uid=Administrator,ou=Users,dc=example,dc=com adding new entry: uid=nobody,ou=Users,dc=example,dc=com adding new entry: cn=Domain Admins,ou=Groups,dc=example,dc=com adding new entry: cn=Domain Users,ou=Groups,dc=example,dc=com adding new entry: cn=Domain Guests,ou=Groups,dc=example,dc=com adding new entry: cn=Print Operators,ou=Groups,dc=example,dc=com adding new entry: cn=Backup Operators,ou=Groups,dc=example,dc=com adding new entry: cn=Replicator,ou=Groups,dc=example,dc=com adding new entry: cn=Domain Computers,ou=Groups,dc=example,dc=comAfter this step, if you don't want to use the cn=Manager,dc=example,dc=com account anymore, you can create a dedicated account for Samba and the smbldap-tools. See section 8.2 for more details.
smbldap-populate -u 1550 -g 1500
For example, if you want to add a user named user_admin and who :
option definition example default value -a create a Windows account. Otherwise, only a Posix account is created -w create a Windows Workstation account -i create an interdomain trust account. See section 4.4 for more details -u set a uid value -u 1003 first uid available -g set a gid value -g 1003 first gid available -G add the new account to one or several supplementary groups (comma-separated) -G 512,550 -d set the home directory -d /var/user $userHomePrefix/user -s set the login shell -s /bin/ksh $userLoginShell -c set the user gecos -c "admin user" $userGecos -m creates user's home directory and copies /etc/skel into it -k set the skeleton dir (with -m) -k /etc/skel2 $skeletonDir -P ends by invoking smbldap-passwd to set the user's password -A user can change password ? 0 if no, 1 if yes -A 1 -B user must change password at first session ? 0 if no, 1 if yes -B 1 -C set the samba home share -C \\PDC\homes $userSmbHome -D set a letter associated with the home share -D H: $userHomeDrive -E set DOS script to execute on login -E common.bat $userScript -F set the profile directory -F \\PDC\profiles\user $userProfile -H set the samba account control bits like'[NDHTUMWSLKI]' -H [X] -N set the canonical name of the user -S set the surname of the user -M local mailAddress (comma seperated) -M testuser,aliasuser -T forward mail address (comma seperated) -T testuser@domain.org
Table 2: Options available to the smbldap-useradd script
smbldap-useradd -a -G 512 -m -s /bin/false -d /dev/null -F "" -P user_admin
For example, if you want to remove the user1 account from the LDAP directory, and if you also want to delete his home directory, use the following command :
option definition -r remove home directory -R remove home directory interactively
Table 3: Option available to the smbldap-userdel script
smbldap-userdel -r user1Note: '-r' is dangerous as it may delete precious and unbackuped data, please be careful.
You can also use the smbldap-userinfo script to update user's information. This script can also be used by users themselves to update their own informations listed in the tables 5 (adequats ACL must be set in the directory server). Available options are :
option definition example -c set the user gecos -c "admin user" -d set the home directory -d /var/user -u set a uid value -u 1003 -g set a gid value -g 1003 -G add the new account to one or several supplementary groups (comma-separated) -G 512,550 -G -512,550 -G +512,550 -s set the login shell -s /bin/ksh -N set the canonical name of the user -S set the surname of the user -P ends by invoking smbldap-passwd to set the user's password -a add sambaSAMAccount objectclass -e set an expiration date for the password (format: YYYY-MM-DD HH:MM:SS) -A user can change password ? 0 if no, 1 if yes -A 1 -B user must change password at first session ? 0 if no, 1 if yes -B 1 -C set the samba home share -C \\PDC\homes -C "" -D set a letter associated with the home share -D H: -D "" -E set DOS script to execute on login -E common.bat -E "" -F set the profile directory -F \\PDC\profiles\user -F "" -H set the samba account control bits like'[NDHTUMWSLKI]' -H [X] -I disable a user account -I 1 -J enable a user -J 1 -M local mailAddress (comma seperated) -M testuser,aliasuser -T forward mail address (comma seperated) -T testuser@domain.org
Table 4: Options available to the smbldap-usermod script
option definition example -f set the full name's user -f MyName -r set the room number -r 99 -w set the work phone number -w 111111111 -h set the home phone number -h 222222222 -o set other information (in gecos definition) -o "second stage" -s set the default bash -s /bin/ksh
Table 5: Options available to the smbldap-userinfo script
option definition example -a add automatic group mapping entry -g gid set the gidNumer for this group to gid -g 1002 -o gidNumber is not unique -r group-rid set the rid of the group to group-rid -r 1002 -s group-sid set the sid of the group to group-sid -s S-1-5-21-3703471949-3718591838-2324585696-1002 -t group-type set the sambaGroupType to group-type -t 2 -p print the gidNumber to stdout
Table 6: Options available for the smbldap-groupadd script
smbldap-userdel group1
[root@etoile root]# smbldap-useradd -i trust-pdc New password : ******* Retype new password : *******The script will terminate asking for a password for this trust account. The account will be created in the directory branch where all computer accounts are stored (ou=Computers by default). The only two particularities of this account are that you are setting a password for this account, and the flags of this account are [I ].
|
|
|
ldapmodify -x -D "cn=Manager,dc=example,dc=org" -w secret -f update-NextFreeUnixId.ldif
[root@slave sbin]# smbldap-populate.pl Using builtin directory structure adding new entry: dc=example,dc=org Can't call method "code" without a package or object reference at /usr/local/sbin/smbldap-populate.pl line 270, <GEN1> line 2.Answer: check the TLS configuration
ldapSSL="0"
ldapSSL="1"and check that the directory server is configured to accept TLS connections.
|
/usr/local/sbin/smbldap-useradd.pl: unknown group SID not set for unix group 513Answer:
net groupmap add rid=513 unixgroup="Domain Users" ntgroup="Domain Users"
Could not find base dn, to get next uidNumber at /usr/local/sbin//smbldap_tools.pm line 909
dn: cn=NextFreeUnixId,dc=example,dc=org objectClass: inetOrgPerson objectClass: sambaUnixIdPool uidNumber: 1000 gidNumber: 1000 cn: NextFreeUnixId sn: NextFreeUnixIdand then add the object with the ldapadd utility:
$ ldapadd -x -D "cn=Manager,dc=example,dc=org" -w secret -f add.ldifHere, 1000 is the first available value for uidNumber and gidNumber (of course, if this value is already used by a user or a group, the first available after 1000 will be used).
Use of uninitialized value in string at /usr/local/sbin//smbldap\_tools.pm line 914. Error: No DN specified at /usr/local/sbin//smbldap\_tools.pm line 919You have not updated the configuration file to defined the object where are sotred the next uidNumber and gidNumber available. In our example, you have to add a nex entry in /etc/opt/IDEALX/smbldap-tools/smbldap.conf containing :
# Where to store next uidNumber and gidNumber available sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"btw, a new option is now available too: the domain to append to users. You can add to the configuration file the following lines:
# Domain appended to the users "mail"-attribute # when smbldap-useradd -M is used mailDomain="idealx.com"
Use of uninitialized value in concatenation (.) or string at /usr/local/sbin/smbldap-useradd line 183. Use of uninitialized value in substitution (s///) at /usr/local/sbin/smbldap-useradd line 185. Use of uninitialized value in string at /usr/local/sbin/smbldap-useradd line 264. failed to add entry: homedirectory: value #0 invalid per syntax at /usr/local/sbin/smbldap-useradd line 280. userHomeDirectory=User "jto" already member of the group "513". failed to add entry: No such object at /usr/local/sbin/smbldap-useradd line 382.you have to change the variable name userHomePrefix to userHome in /etc/opt/IDEALX/smbldap-tools/smbldap.conf
failed to add entry: referral missing at /usr/local/sbin/smbldap-useradd line 279, <DATA> line 283.you have to update the configuration file that defined users, groups and computers dn. Those parameters must not be relative to the suffix parameter. A typical configuration look like this :
usersdn="ou=Users,${suffix}" computersdn="ou=Computers,${suffix}" groupsdn="ou=Groups,${suffix}"
erreur LDAP: Can't contact master ldap server (IO::Socket::INET: Bad protocol 'tcp') at /usr/local/sbin//smbldap_tools.pm line 153.remove ldap from /etc/nsswitch.conf for services list of possible check. For example, if your ldap directory is not configured to give services information, you must have
services filesand not
services: ldap [NOTFOUND=return] files
|
|
|
|
smbldap-useradd -s /bin/false -d /dev/null -P sambaThis command will ask you to set a password for this account. Let's set it to samba for this example. You then need to modify configuration files:
|
|
smbpasswd -w samba
|
Documents : Copyright © 2002 IDEALX S.A.S.. 'IDEALX' is the property of IDEALX. 'Samba' is the property of Samba Team. All other trademarks belong to their respective owners.
This document was translated from LATEX by HEVEA.