Running the Script
This project consists of several different scripts (smbldap-install and smbldap-configure, for example), and they can each be run individually, or you can just use the smbldap "wrapper" script to run them for you. (This is what is demonstrated on this page.)
Important: Note for Fedora Core Notes for Ubuntu
Below you'll see actual captured output of the script as it runs.
root@pc-03855:/home/dtrask/smbldap-installer# ./smbldap all Reading package lists... Done Building dependency tree... Done libgetopt-mixed-perl is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded. ########################################################### Starting Samba/LDAP Installation: Sat Oct 29 00:26:40 2005 This script will only work [well] for versions of distributions of GNU/Linux that have been entered in distro_data.pm. Feel free to add new versions/distros and share your updated distro_data.pm file! Note that in many cases the default answers for the following questions will work. Please select your Linux distribution from the following options: [k12ltsp-4.2.1] fc3 fc4 k12ltsp-4.2 k12ltsp-4.2.1 k12ltsp-4.4.0-beta k12ltsp-4.4.1 ubuntu ubuntu Using distribution=ubuntu Using distribution_media=cd Trying to install packages from the Internet... Reading package lists... Done Building dependency tree... Done ldap-utils is already the newest version. slapd is already the newest version. smbldap-tools is already the newest version. samba is already the newest version. nscd is already the newest version. nfs-kernel-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded. This script has appended its output to /home/dtrask/smbldap-installer/smbldap-install.log. Removing my temporary directory /tmp/.Sat_Oct_29_00_26_40_2005-8379... Congratulations! It looks like we've succeeded in installing the packages necessary for you to configure a Samba/LDAP server. ########################################################### Starting Samba/LDAP Config: Sat Oct 29 00:26:50 2005 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Furthermore, you should definitely not run this script on an existing LDAP production server unless you've tested everything and you are confident that you know what you are doing. Consider yourself warned! Executable for slapd found: /usr/sbin/slapd Executable for smbd found: /usr/sbin/smbd Executable for smbldap-populate found: /usr/sbin/smbldap-populate smbusers: using /etc/samba/smbusers cosine.schema: using /etc/ldap/schema/cosine.schema openldap_ldap.conf: using /etc/ldap/ldap.conf slapd.conf: using /etc/ldap/slapd.conf samba.schema: using /etc/ldap/schema/samba.schema core.schema: using /etc/ldap/schema/core.schema smbldap_bind.conf: using /etc/smbldap-tools/smbldap_bind.conf smb.conf: using /etc/samba/smb.conf inetorgperson.schema: using /etc/ldap/schema/inetorgperson.schema back_bdb.so: using /usr/lib/ldap/back_bdb.so nis.schema: using /etc/ldap/schema/nis.schema etc_ldap.conf: using /etc/ldap.conf smbldap.conf: using /etc/smbldap-tools/smbldap.conf Running /etc/init.d/slapd stop Running /etc/init.d/samba stop I found the smbldap-tools in /usr/sbin/ Please enter your domain name: [example.com] booger.net Using domain=booger.net Using dc_domain=dc=booger,dc=net Please enter your windows domain (workgroup) name: [BOOGERNET] Using Windows domain=BOOGERNET Please enter your windows netbios name: [BOOGERNET-PDC] Using Windows netbios name=BOOGERNET-PDC Please enter your LDAP password: Please verify your LDAP password: Please enter the drive letter of user spaces in Windows: [X] f Using Windows user space drive letter=f Please enter the maximum password age (in days) for your network: [999] Your system has the following network interfaces. eth0: eth1: 10.0.15.15 Please enter a comma-separated list of the interfaces connected to your Windows/SAMBA network: [eth0,eth1] Using net_interfaces=eth0,eth1 Will other Linux machines need to access home directories stored on this server? [y/N] y Please enter the network you wish to allow NFS access to /home on this system. Here is a guess based on your current network configuration: 10.0.15.15/255.255.240.0 10.0.0.0/255.255.240.0 Using nfs_net=10.0.0.0/255.255.240.0 Backing up "/etc/samba/smbusers" at "/etc/samba/smbusers-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/ldap/ldap.conf" at "/etc/ldap/ldap.conf-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/ldap/slapd.conf" at "/etc/ldap/slapd.conf-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/ldap/schema/samba.schema" at "/etc/ldap/schema/samba.schema-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/samba/smb.conf" at "/etc/samba/smb.conf-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/ldap.conf" at "/etc/ldap.conf-Sat_Oct_29_00_26_50_2005.bak" Running /etc/init.d/slapd restart Setting the manager smbpasswd... Grabbing local SID...success! Backing up "/etc/samba/smbusers" at "/etc/samba/smbusers-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/ldap/ldap.conf" at "/etc/ldap/ldap.conf-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/ldap/slapd.conf" at "/etc/ldap/slapd.conf-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/ldap/schema/samba.schema" at "/etc/ldap/schema/samba.schema-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/smbldap-tools/smbldap_bind.conf" at "/etc/smbldap-tools/smbldap_bind.conf-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/samba/smb.conf" at "/etc/samba/smb.conf-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/ldap.conf" at "/etc/ldap.conf-Sat_Oct_29_00_26_50_2005.bak" Backing up "/etc/smbldap-tools/smbldap.conf" at "/etc/smbldap-tools/smbldap.conf-Sat_Oct_29_00_26_50_2005.bak" Running smbldap-populate...success. Setting root's smbpasswd... Running /etc/init.d/samba restart Running /etc/init.d/nscd restart Creating the /opt/samba/profiles directory... Setting permissions for /opt/samba/profiles... Creating the /opt/samba/netlogon directory... Creating sample startup.bat file... Backing up "/opt/samba/netlogon/startup.bat" at "/opt/samba/netlogon/startup.bat-Sat_Oct_29_00_26_50_2005.bak" Running Debian/Ubuntu client configuration in 20 seconds... You will be prompted several times during the configuration. In your answers change "dc=example,dc=net" to "dc=booger,dc=net" Make sure when you are asked for a password that you type the same password you did earlier. Other than the above two things, the default answers are fine. Reading package lists... Done Building dependency tree... Done libgetopt-mixed-perl is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded. Configuring LDAP client... Backing up PAM and NSSwitch in /root/default-authentication-configuration.tgz... Reading package lists... Done Building dependency tree... Done libpam-ldap is already the newest version. libnss-ldap is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded. success. Setting up NFS share of /home by adding the following line to /etc/exports: /home 10.0.0.0/255.255.240.0(rw,sync) Edit this file later to change the export parameters. Running /etc/init.d/nfs-kernel-server restart This script has appended its output to /home/dtrask/smbldap-installer/smbldap-configure.log. Congratulations! It looks like we've succeeded. You'll need to reboot any clients you configure to authenticate to this server. (Note that if this system authenticates to it's own LDAP server, it must be rebooted.) Please note your LDAP base: dc=booger,dc=net Bye-bye. Configuring rotated LDIF backups... How often do you want your LDAP database backed up? [daily] Here are your choices: hourly daily weekly monthly How often do you want your backup files rotated? [weekly] Here are your choices: daily weekly monthly How many rotated backup files do you wish to keep? [8] In which directory do you want the LDIF backups to be stored? [/var/lib/ldap/ldif-backups] /etc/logrotate.d/smbldap-ldif-backups already exists, will overwrite in 10 seconds (CTRL+C to cancel)... /etc/cron.daily/smbldap-ldif-backup already exists, will overwrite in 10 seconds (CTRL+C to cancel)... root@pc-03855:/home/dtrask/smbldap-installer#