2005-03-08 06:23:08 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
2005-03-13 18:25:08 +00:00
<!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
2005-03-08 06:23:08 +00:00
<chapter id= "nw4migration" >
2005-04-22 01:46:37 +00:00
<title > Migrating NetWare Server to Samba-3</title>
2005-03-08 06:23:08 +00:00
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > Novell</primary> </indexterm>
2005-04-22 05:00:22 +00:00
<indexterm > <primary > SUSE</primary> </indexterm>
2005-05-25 21:40:55 +00:00
Novell is a company any seasoned IT manager has to admire. It has become increasingly
Linux-friendly and is emerging out of a deep regression that almost saw the company
2005-04-22 05:00:22 +00:00
disappear into obscurity. Novell's SUSE Linux hosts the NetWare server and it is the
platform of choice to which many older NetWare servers are being migrated.
2005-05-25 21:40:55 +00:00
It will be interesting to see what becomes of NetWare over time.
Meanwhile, there can be no denying that Novell is a Linux company.
2005-03-08 06:23:08 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > Red Hat</primary> </indexterm>
<indexterm > <primary > Debian</primary> </indexterm>
<indexterm > <primary > Gentoo</primary> </indexterm>
<indexterm > <primary > Mandrake</primary> </indexterm>
Whatever flavor of Linux is preferred in your environment, whether Red Hat, Debian,
2005-05-25 21:40:55 +00:00
Gentoo, Mandrake, or SUSE (Novell), the information in this chapter should be read with
the knowledge that file locations may vary a little; even so, the information
2005-03-10 07:36:23 +00:00
in this chapter should provide something of value.
</para>
<para >
<indexterm > <primary > migration</primary> </indexterm>
2005-05-25 21:40:55 +00:00
Contributions to this chapter were made by Misty Stanley-Jones, a UNIX administrator of many
years who surfaced on the Samba mailing list with a barrage of questions and who
2005-06-13 15:29:53 +00:00
regularly helps other administrators to solve thorny Samba migration questions.
2005-03-08 06:23:08 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > NetWare</primary> </indexterm>
<indexterm > <primary > NLM</primary> </indexterm>
<indexterm > <primary > NetWare</primary> </indexterm>
<indexterm > <primary > Mars_NWE</primary> </indexterm>
2005-03-08 06:23:08 +00:00
One wonders how many NetWare servers remain in active service. Many are being migrated
2005-05-25 21:40:55 +00:00
to Samba on Linux. Red Hat Linux, SUSE Linux 9.x, and SUSE Linux Enterprise Server 9 are
2005-03-10 07:36:23 +00:00
ideal target platforms to which a NetWare server may be migrated. The migration method
2005-05-25 21:40:55 +00:00
of choice is much dependent on the tools that the administrator finds most natural to use.
The old-hand NetWare guru will likely want to use tools like the NetWare NLM for
2005-03-10 07:36:23 +00:00
<command > rsync</command> to migrate files from the NetWare server to the Samba server.
2005-03-14 18:50:40 +00:00
The UNIX administrator might prefer tools that are part of the Mars_NWE (Martin Stovers' NetWare
2005-03-10 07:36:23 +00:00
Emulator) open source package. The MS Windows network administrator will likely make use of the
NWConv utility that is a part of Windows NT4 Server. Whatever your tool of choice,
2005-05-25 21:40:55 +00:00
migration will be filled with joyous and challenging moments &smbmdash; though probably not
2005-03-08 06:23:08 +00:00
concurrently.
</para>
2005-04-23 15:45:07 +00:00
<para >
The priority that Misty faced was one of migration of the data files off the NetWare 4.11
2005-06-13 15:29:53 +00:00
server and onto a Samba-based Windows file and print server. This chapter does not pretend
2005-04-23 15:45:07 +00:00
to document all the different methods that could be used to migrate user and group accounts
2005-05-25 21:40:55 +00:00
off a NetWare server. Its focus is on migration of data files.
2005-04-23 15:45:07 +00:00
</para>
2005-03-08 06:23:08 +00:00
<para >
2005-05-25 21:40:55 +00:00
This chapter tells its own story, so ride along. Maybe the information presented here
2005-03-10 00:09:15 +00:00
will help to smooth over a similar migration challenge in your favorite networking environment.
2005-03-08 06:23:08 +00:00
</para>
2005-04-23 15:45:07 +00:00
<para >
File paths have been modified to permit use of RPM packages provided by Novell. In the
2005-05-25 21:40:55 +00:00
original documentation contributed by Misty, the Courier-IMAP package had been built
2005-04-23 15:45:07 +00:00
directly from the original source tarball.
</para>
2005-03-08 06:23:08 +00:00
<sect1 >
<title > Introduction</title>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > Novell</primary> </indexterm>
2005-05-25 21:40:55 +00:00
Misty Stanley-Jones was recruited by Abmas to administer a network that had
not received much attention for some years and was much in need of a makeover.
As a brand-new sysadmin to this company, she inherited a very old Novell file server
2005-03-08 06:23:08 +00:00
and came with a determination to change things for the better.
</para>
<para >
A site survey turned up the following details for the old NetWare server:
</para>
<simplelist >
2009-05-01 22:00:19 +02:00
<member > 200 MHz MMX processor</member>
<member > 512K RAM</member>
<member > 24 GB disk space in RAID1</member>
<member > Novell 4.11 patched to service pack 7</member>
<member > 60+ users</member>
<member > 7 network-attached printers</member>
2005-03-08 06:23:08 +00:00
</simplelist>
<para >
2005-05-25 21:40:55 +00:00
The company had outgrown this server several years before and was dealing with
2005-03-08 06:23:08 +00:00
severe growing pains. Some of the problems experienced were:
</para>
<itemizedlist >
<listitem >
<para > Very slow performance</para>
</listitem>
<listitem >
2005-05-25 21:40:55 +00:00
<para > Available storage hovering around the 5% range</para>
2005-03-08 06:23:08 +00:00
<itemizedlist >
<listitem >
<para > Extremely slow print spooling.</para>
</listitem>
<listitem >
<para >
Users storing information on their local hard
2005-05-25 21:40:55 +00:00
drives, causing backup integrity problems
2005-03-08 06:23:08 +00:00
</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > payroll</primary> </indexterm>
2005-05-25 21:40:55 +00:00
At one point disk space had filled up to 100 percent, causing the payroll database
2005-03-08 06:23:08 +00:00
to become corrupt. This caused the accounting department to be down for over
a week and necessitated deployment of another file server. The replacement
server was created with very poor security and design considerations from
a discarded desktop PC.
</para>
<sect2 >
<title > Assignment Tasks</title>
<para >
2005-03-10 00:09:15 +00:00
Misty has provided this summary of her migration experience in the hope
that it will help someone to avoid the challenges she faced. Perhaps her
2005-03-10 07:36:23 +00:00
configuration files and background will accelerate your learning as you
2005-04-23 15:45:07 +00:00
grapple with a similar migration challenge. Let there be no confusion,
the information presented in this chapter is provided to demonstrate
2005-05-25 21:40:55 +00:00
how Misty dealt with a particular NetWare migration requirement, and
it provides an overall approach to the implementation of a Samba-3
2005-04-23 15:45:07 +00:00
environment that is significantly divergent from that presented in
<link linkend= "happy" /> .
</para>
<para >
The complete removal of all site-specific information in order to produce
a generic migration solution would rob this chapter of its character.
2005-05-25 21:40:55 +00:00
It should be recognized, therefore, that the examples given require
significant adaptation to suit local needs and thus
there are some gaps in the example files. That is not Misty's fault;it
2005-04-24 04:57:50 +00:00
is the result of treatment given to her files in an attempt to make
2005-04-23 15:45:07 +00:00
the overall information more useful to you.
2005-03-08 06:23:08 +00:00
</para>
<para >
2005-04-23 15:45:07 +00:00
<indexterm > <primary > cost-benefit</primary> </indexterm>
2005-05-25 21:40:55 +00:00
After management reviewed a cost-benefit report as well as an estimated
2005-03-10 07:36:23 +00:00
time-to-completion, approval was given proceed with the solution proposed.
2005-03-10 00:09:15 +00:00
The server was built from purchased components. The total project cost
2005-05-25 21:40:55 +00:00
was $3,000. A brief description of the configuration follows:
2005-03-08 06:23:08 +00:00
</para>
<simplelist >
<member >
2009-05-01 22:00:19 +02:00
3.0 GHz P4 Processor
2005-03-08 06:23:08 +00:00
</member>
<member >
2009-05-01 22:00:19 +02:00
1 GB RAM
2005-03-08 06:23:08 +00:00
</member>
<member >
2009-05-01 22:00:19 +02:00
120 GB SATA operating system drive
2005-03-08 06:23:08 +00:00
</member>
<member >
2009-05-01 22:00:19 +02:00
4 x 80 GB SATA data drives (RAID5 240 GB capacity)
2005-03-08 06:23:08 +00:00
</member>
<member >
2009-05-01 22:00:19 +02:00
2 x 80 GB SATA removable drives for online backup
2005-03-08 06:23:08 +00:00
</member>
<member >
2009-05-01 22:00:19 +02:00
A DLT drive for asynchronous offline backup
2005-03-08 06:23:08 +00:00
</member>
<member >
2009-05-01 22:00:19 +02:00
SUSE Linux Professional 9.1
2005-03-08 06:23:08 +00:00
</member>
</simplelist>
2005-03-09 07:59:06 +00:00
<para >
2005-05-25 21:40:55 +00:00
The new system has operated for 6 months without problems. Over the past months
2005-03-10 07:36:23 +00:00
much attention has been focused on cleaning up desktops and user profiles.
2005-03-09 07:59:06 +00:00
</para>
2005-03-08 06:23:08 +00:00
</sect2>
</sect1>
<sect1 >
<title > Dissection and Discussion</title>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > LDAP</primary> </indexterm>
<indexterm > <primary > e-Directory</primary> </indexterm>
<indexterm > <primary > authentication</primary> </indexterm>
<indexterm > <primary > identity management</primary> </indexterm>
2005-05-25 21:40:55 +00:00
A decision to use LDAP was made even though I knew nothing about LDAP except that
I had been reading the book <quote > LDAP System Administration,</quote> by Gerald Carter.
2005-03-08 06:23:08 +00:00
LDAP seemed to provide some of the functionality of Novell's e-Directory Services
and would provide centralized authentication and identity management.
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > database</primary> </indexterm>
<indexterm > <primary > RPM</primary> </indexterm>
<indexterm > <primary > tree</primary> </indexterm>
2005-05-25 21:40:55 +00:00
Building the LDAP database took a while and a lot of trial and error. Following
the guidance I obtained from <quote > LDAP System
Administration,</quote> I installed OpenLDAP (from RPM; later I compiled
2005-03-08 06:23:08 +00:00
a more current version from source) and built my initial LDAP tree.
</para>
<sect2 >
<title > Technical Issues</title>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > white-pages</primary> </indexterm>
<indexterm > <primary > inetOrgPerson</primary> </indexterm>
<indexterm > <primary > OpenLDAP</primary> </indexterm>
<indexterm > <primary > /etc/passwd</primary> </indexterm>
<indexterm > <primary > /etc/shadow</primary> </indexterm>
<indexterm > <primary > LDIF</primary> </indexterm>
<indexterm > <primary > IMAP</primary> </indexterm>
<indexterm > <primary > POP3</primary> </indexterm>
<indexterm > <primary > SMTP</primary> </indexterm>
2005-05-25 21:40:55 +00:00
The first challenge was to create a company white pages, followed by manually
2005-03-10 07:36:23 +00:00
entering everything from the printed company directory. This used only the inetOrgPerson
2005-05-25 21:40:55 +00:00
object class from the OpenLDAP schemas. The next step was to write a shell script that
2005-03-08 06:23:08 +00:00
would look at the <filename > /etc/passwd</filename> and <filename > /etc/shadow</filename>
2005-06-13 15:29:53 +00:00
files on our mail server and create an LDIF file from which the information could be
2005-03-08 06:23:08 +00:00
imported into LDAP. This would allow use of LDAP for Linux authentication, IMAP, POP3,
and SMTP.
</para>
2005-03-14 18:50:40 +00:00
<para >
2005-05-25 21:40:55 +00:00
Because a decision was made to use Courier-IMAP the schema <quote > authldap.schema</quote>
from the Courier-IMAP source, tarball is necessary to resolve Courier-specific LDAP directory
needs. Where the Courier-IMAP file provided by SUSE is used, this file is named
2005-04-23 15:45:07 +00:00
<filename > courier.schema</filename> .
2005-03-14 18:50:40 +00:00
</para>
2005-04-23 15:45:07 +00:00
<para >
Looking back, it would have been much easier to populate the LDAP directory using a convenient
tool such as <command > phpLDAPAdmin</command> from the outset. An excessive amount of time was
spent trying to generate LDIF files that could be parsed using the <command > ldapmodify</command>
so that necessary changes could be written to the directory. This was a learning experience!
</para>
<para >
2005-05-25 21:40:55 +00:00
An attempt was made to use the PADL POSIX account migration scripts, but I gave up trying to
2005-04-24 04:57:50 +00:00
make them work. Instead, even though it is most inelegant, I wrote a simple script that did
2005-04-23 15:45:07 +00:00
what I needed. It is enclosed as a simple example to demonstrate that you do not need to be
a guru to make light of otherwise painful repetition. This file is listed in <link linkend= "sbeamg" /> .
</para>
<example id= "sbeamg" >
2005-04-24 04:57:50 +00:00
<title > A Rough Tool to Create an LDIF File from the System Account Files</title>
2005-04-23 15:45:07 +00:00
<screen >
#!/bin/bash
cat /etc/passwd | while read l; do
uid=`echo $l | cut -d : -f 1`
uidNumber=`echo $l | cut -d : -f 3`
gidNumber=`echo $1 | cut -d : -f 4`
gecos=`echo $l | cut -d : -f 5`
homeDirectory=`echo $l | cut -d : -f 6`
loginShell=`echo $l | cut -d : -f 6`
userPassword=`cat /etc/shadow | grep $uid | cut -d : -f 2`
echo "dn: cn=$gecos,ou=people,dc=mycompany,dc=com"
echo "objectClass: account"
echo "objectClass: posixAccount"
echo "cn: $gecos"
echo "uid: $uid"
echo "uidNumber: $uidNumber"
echo "gidNumber: $gidNumber"
echo "homeDirectory: $homeDirectory"
echo "loginShell: $loginShell"
echo "userPassword: $userPassword"
done
</screen>
</example>
<note > <para >
2005-05-25 21:40:55 +00:00
2005-04-23 15:45:07 +00:00
The PADL MigrationTools are recommended for migration of the UNIX account information into
the LDAP directory. The tools consist of a set of Perl scripts for migration of users, groups,
2005-04-24 04:57:50 +00:00
aliases, hosts, netgroups, networks, protocols, PRCs, and services from the existing ASCII text
2005-04-23 15:45:07 +00:00
files (or from a name service such as NIS). This too set can be obtained from the <ulink url=
2005-05-25 21:40:55 +00:00
"http://www.padl.com">PADL Web site</ulink> .
2005-04-23 15:45:07 +00:00
</para> </note>
2005-03-08 06:23:08 +00:00
</sect2>
</sect1>
<sect1 >
<title > Implementation</title>
<para >
</para>
<sect2 >
<title > NetWare Migration Using LDAP Backend</title>
2005-03-09 07:59:06 +00:00
<para >
The following software must be installed on the SUSE Linux Enterprise Server to perform
this migration:
</para>
<simplelist >
2009-05-01 22:00:19 +02:00
<member > courier-imap</member>
<member > courier-imap-ldap</member>
<member > nss_ldap</member>
<member > openldap2-client</member>
<member > openldap2-devel (only for Samba compilation)</member>
<member > openldap2</member>
<member > pam_ldap</member>
<member > samba-3.0.20 or later</member>
<member > samba-client-3.0.20 or later</member>
<member > samba-winbind-3.0.20 or later</member>
<member > smbldap-tools Version 0.9.1</member>
2005-03-09 07:59:06 +00:00
</simplelist>
<para >
Each software application must be carefully configured in preparation for migration.
2005-03-10 00:09:15 +00:00
The configuration files used at Abmas are provided as a guide and should be modified
2005-03-09 07:59:06 +00:00
to meet needs at your site.
</para>
<sect3 >
<title > LDAP Server Configuration</title>
<para >
2005-04-23 15:45:07 +00:00
The <filename > /etc/openldap/slapd.conf</filename> file Misty used is shown here:
<programlisting >
2005-04-22 05:00:22 +00:00
#/etc/openldap/slapd.conf
2005-03-09 07:59:06 +00:00
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
2005-03-10 00:09:15 +00:00
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
2005-04-23 15:45:07 +00:00
include /etc/openldap/schema/samba3.schema
2005-03-10 00:09:15 +00:00
include /etc/openldap/schema/dhcp.schema
include /etc/openldap/schema/misc.schema
include /etc/openldap/schema/idpool.schema
include /etc/openldap/schema/eduperson.schema
include /etc/openldap/schema/commURI.schema
include /etc/openldap/schema/local.schema
2005-04-23 15:45:07 +00:00
include /etc/openldap/schema/courier.schema
2005-03-09 07:59:06 +00:00
pidfile /var/run/slapd/run/slapd.pid
argsfile /var/run/slapd/run/slapd.args
2005-03-10 00:09:15 +00:00
replogfile /data/ldap/log/slapd.replog
2005-03-09 07:59:06 +00:00
# Load dynamic backend modules:
modulepath /usr/lib/openldap/modules
#######################################################################
# Logging parameters
#######################################################################
loglevel 256
2005-03-10 01:31:22 +00:00
2005-03-09 07:59:06 +00:00
#######################################################################
# SASL and TLS options
#######################################################################
2005-03-10 00:09:15 +00:00
sasl-host ldap.corp.abmas.org
2005-03-09 07:59:06 +00:00
sasl-realm DIGEST-MD5
sasl-secprops none
TLSCipherSuite HIGH:MEDIUM:+SSLV2
2005-03-10 01:31:22 +00:00
TLSCertificateFile /etc/ssl/certs/private/abmas-cert.pem
2005-03-10 00:09:15 +00:00
TLSCertificateKeyFile /etc/ssl/certs/private/abmas-key.pem
2005-03-09 07:59:06 +00:00
password-hash {SSHA}
2005-03-10 00:09:15 +00:00
defaultsearchbase "dc=abmas,dc=biz"
2005-03-10 01:31:22 +00:00
2005-03-09 07:59:06 +00:00
#######################################################################
# bdb database definitions
#######################################################################
2005-03-10 00:09:15 +00:00
database bdb
suffix "dc=abmas,dc=biz"
rootdn "cn=manager,dc=abmas,dc=biz"
rootpw {SSHA}gdo/dUvoT4ZJmULz3rUt6A3H/hBEduJ5
directory /data/ldap
2005-03-09 07:59:06 +00:00
mode 0600
# The following is for BDB to make it flush its data to disk every
# 500 seconds or 5kb of data
checkpoint 500 5
## For running slapindex
#readonly on
## Indexes for often-requested attributes
2005-03-10 00:09:15 +00:00
index objectClass eq
index cn eq,sub
index sn eq,sub
index uid eq,sub
index uidNumber eq
index gidNumber eq
index sambaSID eq
index sambaPrimaryGroupSID eq
index sambaDomainName eq
index default sub
2005-03-09 07:59:06 +00:00
cachesize 2000
2005-03-10 00:09:15 +00:00
replica host=baa.corp.abmas.org:389
suffix="dc=abmas,dc=biz"
binddn="cn=replica,dc=abmas,dc=biz"
2005-03-09 07:59:06 +00:00
credentials=verysecret
bindmethod=simple
tls=yes
2005-03-10 00:09:15 +00:00
replica host=ns.abmas.org:389
suffix="dc=abmas,dc=biz"
binddn="cn=replica,dc=abmas,dc=biz"
2005-03-09 07:59:06 +00:00
credentials=verysecret
bindmethod=simple
tls=yes
#######################################################################
# ACL section
#######################################################################
## MOST RESTRICTIVE RULES MUST GO FIRST!
2005-04-23 15:45:07 +00:00
# Admins get access to everything. This way I do not have to rename.
access to *
by group/groupOfUniqueNames/uniqueMember="cn=LDAP
Administrators,ou=groups,dc=abmas,dc=biz" write
by * break
## Users can change their own passwords.
access to
attrs=userPassword,sambaNTPassword,sambaLMPassword,sambaPwdLastSet,
sambaPwdMustChange,sambaPwdCanChange
2005-03-09 07:59:06 +00:00
by self write
by * auth
2005-04-23 15:45:07 +00:00
## Home contact info restricted to the logged-in user and the HR dept
access to attrs=hometelephoneNumber,homePostalAddress,
mobileTelephoneNumber,pagerTelephoneNumber
by group/groupOfUniqueNames/uniqueMember="cn=hr_admin,
ou=groups,dc=abmas,dc=biz"
write
2005-03-09 07:59:06 +00:00
by self write
by * none
2005-04-23 15:45:07 +00:00
## Everyone can read email aliases
2005-03-10 00:09:15 +00:00
access to dn.sub="ou=Email Aliases,dc=abmas,dc=biz"
2005-04-23 15:45:07 +00:00
by * read
## Only admins can manage email aliases
## If someone is the role occupant of an alias they can change it -- this
## is accomplished by the "organizationalRole" objectclass and is
## pretty cool -- like a groupOfUniqueNames but for individual
## users.
access to dn.children="ou=Email Aliases,dc=abmas,dc=biz"
2005-03-09 07:59:06 +00:00
by dnattr=roleOccupant write
by * read
2005-04-23 15:45:07 +00:00
## Admins and HR can add and delete users
access to dn.sub="ou=people,dc=abmas,dc=biz"
by group/groupOfUniqueNames/uniqueMember="cn=hr_admin,
ou=groups,dc=abmas,dc=biz"
write
by * read
## Admins and HR can add and delete bizputers
access to dn.sub="ou=bizputers,dc=abmas,dc=biz"
by group/groupOfUniqueNames/uniqueMember="cn=hr_admin,
ou=groups,dc=abmas,dc=biz"
write
by * read
## Admins and HR can add and delete groups
access to dn.sub="ou=groups,dc=abmas,dc=biz"
by group/groupOfUniqueNames/uniqueMember="cn=hr_admin,
ou=groups,dc=abmas,dc=biz"
write
by * read
2005-07-04 19:20:02 +00:00
## This is used to quickly deactivate any LDAP object only
## Admins have access.
2005-04-23 15:45:07 +00:00
access to dn.sub="ou=inactive,dc=abmas,dc=biz"
by * none
## This is for programs like Windows Address Book that can
## detect the default search base.
access to attrs=namingcontexts,supportedControl
by anonymous =cs
2005-03-09 07:59:06 +00:00
by * read
## Default to read-only access
access to *
2005-04-23 15:45:07 +00:00
by dn.base="cn=replica,ou=people,dc=abmas,dc=biz" write
2005-03-09 07:59:06 +00:00
by * read
2005-04-23 15:45:07 +00:00
</programlisting>
</para>
2005-03-09 07:59:06 +00:00
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > /etc/ldap.conf</primary> </indexterm>
2005-03-10 01:31:22 +00:00
The <filename > /etc/ldap.conf</filename> file used is listed in <link linkend= "ch8ldap" /> .
</para>
<example id= "ch8ldap" >
<title > NSS LDAP Control File &smbmdash; /etc/ldap.conf</title>
2005-03-09 07:59:06 +00:00
<screen >
# /etc/ldap.conf
# This file is present on every *NIX client that authenticates to LDAP.
2005-03-10 00:09:15 +00:00
# For me, most of the defaults are fine. There is an amazing amount of
# customization that can be done see the man page for info.
2005-03-09 07:59:06 +00:00
2005-03-10 00:09:15 +00:00
# Your LDAP server. Must be resolvable without using LDAP. The following
# is for the LDAP server all others use the FQDN of the server
2005-03-09 07:59:06 +00:00
URI ldap://127.0.0.1
# The distinguished name of the search base.
2005-03-10 00:09:15 +00:00
base ou=corp,dc=abmas,dc=biz
2005-03-09 07:59:06 +00:00
2005-03-10 00:09:15 +00:00
# The LDAP version to use (defaults to 3 if supported by client library)
2005-03-09 07:59:06 +00:00
ldap_version 3
2005-03-10 00:09:15 +00:00
# The distinguished name to bind to the server with if the effective
# user ID is root. Password is stored in /etc/ldap.secret (mode 600)
rootbinddn cn=Manager,dc=abmas,dc=biz
2005-03-09 07:59:06 +00:00
# Filter to AND with uid=%s
2005-04-24 04:57:50 +00:00
pam_filter objectclass=posixAccount
2005-03-09 07:59:06 +00:00
# The user ID attribute (defaults to uid)
pam_login_attribute uid
# Group member attribute
pam_member_attribute memberUID
# Use the OpenLDAP password change
# extended operation to update the password.
pam_password exop
# OpenLDAP SSL mechanism
# start_tls mechanism uses the normal LDAP port, LDAPS typically 636
ssl start_tls
2005-03-10 00:09:15 +00:00
tls_cacertfile /etc/ssl/certs/private/abmas-cert.pem
2005-03-09 07:59:06 +00:00
...
</screen>
2005-03-10 01:31:22 +00:00
</example>
2005-03-09 07:59:06 +00:00
<para >
2005-05-25 21:40:55 +00:00
The NSS control file <filename > /etc/nsswitch.conf</filename> has the following contents:
2005-03-09 07:59:06 +00:00
<screen >
# /etc/nsswitch.conf
# This file controls the resolve order for system databases.
# the following two lines obviate the "+" entry in /etc/passwd and /etc/group.
2005-04-23 15:45:07 +00:00
passwd: compat ldap
group: compat ldap
2005-03-10 00:09:15 +00:00
# The above are all that I store in LDAP at this point. There are
# possibilities to store hosts, services, ethers, and lots of other things.
2005-03-09 07:59:06 +00:00
</screen>
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > PAM</primary> </indexterm>
<indexterm > <primary > NSS</primary> </indexterm>
2005-03-09 07:59:06 +00:00
In my setup, users authenticate via PAM and NSS using LDAP-based accounts.
2005-04-23 15:45:07 +00:00
The configuration file that controls the behavior of the PAM <command > pam_unix2</command>
module is shown in <link linkend= "sbepu2" /> file.
2005-03-09 07:59:06 +00:00
This works out of the box with the configuration files in this chapter. It
enables you to have no local accounts for users (it is highly advisable
2005-05-25 21:40:55 +00:00
to have a local account for the root user). Traps for the unwary include the following:
2005-03-09 07:59:06 +00:00
</para>
2005-04-23 15:45:07 +00:00
<example id= "sbepu2" >
<title > The PAM Control File <filename > /etc/security/pam_unix2.conf</filename> </title>
<screen >
# pam_unix2 config file
#
# This file contains options for the pam_unix2.so module.
# It contains a list of options for every type of management group,
# which will be used for authentication, account management and
# password management. Not all options will be used from all types of
# management groups.
#
# At first, pam_unix2 will read this file and then uses the local
# options. Not all options can be set her global.
#
# Allowed options are:
#
# debug (account, auth, password, session)
# nullok (auth)
# md5 (password / overwrites /etc/default/passwd)
# bigcrypt (password / overwrites /etc/default/passwd)
# blowfish (password / overwrites /etc/default/passwd)
# crypt_rounds=XX
# none (session)
# trace (session)
# call_modules=x,y,z (account, auth, password)
#
# Example:
# auth: nullok
# account:
# password: nullok blowfish crypt_rounds=8
# session: none
#
auth: use_ldap
account: use_ldap
password: use_ldap
session: none
</screen>
</example>
2005-03-10 07:36:23 +00:00
<indexterm > <primary > LDAP</primary> </indexterm>
<indexterm > <primary > authenticate</primary> </indexterm>
<indexterm > <primary > DNS</primary> </indexterm>
2005-03-09 07:59:06 +00:00
<itemizedlist >
<listitem >
<para >
If your LDAP database goes down, nobody can authenticate except for root.
</para>
</listitem>
<listitem >
<para >
2005-05-25 21:40:55 +00:00
If failover is configured incorrectly, weird behavior can occur. For example,
DNS can fail to resolve.
2005-03-09 07:59:06 +00:00
</para>
</listitem>
</itemizedlist>
<para >
I do have two LDAP slave servers configured. That subject is beyond the scope
2005-05-25 21:40:55 +00:00
of this document, and steps for implementing it are well documented.
2005-03-09 07:59:06 +00:00
</para>
<para >
The following services authenticate using LDAP:
2005-03-10 00:09:15 +00:00
</para>
2005-03-10 07:36:23 +00:00
<indexterm > <primary > UNIX</primary> </indexterm>
<indexterm > <primary > Postfix</primary> </indexterm>
<indexterm > <primary > Courier-IMAP</primary> </indexterm>
2005-03-09 07:59:06 +00:00
<simplelist >
2009-05-01 22:00:19 +02:00
<member > UNIX login/ssh</member>
<member > Postfix (SMTP)</member>
<member > Courier-IMAP/IMAPS/POP3/POP3S</member>
2005-03-09 07:59:06 +00:00
</simplelist>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > white-pages</primary> </indexterm>
<indexterm > <primary > Windows Address Book</primary> </indexterm>
2005-05-25 21:40:55 +00:00
Companywide white pages can be searched using an LDAP client
2005-03-09 07:59:06 +00:00
such as the one in the Windows Address Book.
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > LDAP</primary> </indexterm>
<indexterm > <primary > smbldap-tools</primary> </indexterm>
2005-05-25 21:40:55 +00:00
Having gained a solid understanding of LDAP and a relatively workable LDAP tree
thus far, it was time to configure Samba. I compiled the latest stable Samba and
2005-03-09 07:59:06 +00:00
also installed the latest <command > smbldap-tools</command> from
<ulink url= "http://idealx.com" > Idealx</ulink> .
</para>
<para >
2005-03-10 01:31:22 +00:00
The Samba &smb.conf; file was configured as shown in <link linkend= "ch8smbconf" /> .
2005-03-09 07:59:06 +00:00
</para>
2005-06-13 00:48:46 +00:00
<example id= "ch8smbconf" >
2005-03-10 01:31:22 +00:00
<title > Samba Configuration File &smbmdash; smb.conf Part A</title>
2005-06-13 00:48:46 +00:00
<smbconfblock >
2005-03-10 01:31:22 +00:00
<smbconfcomment > Global parameters</smbconfcomment>
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[global]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "workgroup" > MEGANET2</smbconfoption>
<smbconfoption name= "netbios name" > MASSIVE</smbconfoption>
<smbconfoption name= "server string" > Corp File Server</smbconfoption>
<smbconfoption name= "passdb backend" > ldapsam:ldap://localhost</smbconfoption>
<smbconfoption name= "pam password change" > Yes</smbconfoption>
<smbconfoption name= "username map" > /etc/samba/smbusers</smbconfoption>
<smbconfoption name= "log level" > 1</smbconfoption>
<smbconfoption name= "log file" > /data/samba/log/%m.log</smbconfoption>
<smbconfoption name= "name resolve order" > wins host bcast</smbconfoption>
<smbconfoption name= "time server" > Yes</smbconfoption>
<smbconfoption name= "printcap name" > cups</smbconfoption>
<smbconfoption name= "show add printer wizard" > No</smbconfoption>
2005-04-23 15:45:07 +00:00
<smbconfoption name= "cups options" > Raw</smbconfoption>
2005-03-12 22:34:38 +00:00
<smbconfoption name= "add user script" > /opt/IDEALX/sbin/smbldap-useradd -m "%u"</smbconfoption>
<smbconfoption name= "add group script" > /opt/IDEALX/sbin/smbldap-groupadd -p "%g"</smbconfoption>
2005-06-13 13:22:50 +00:00
<smbconfoption name= "add user to group script" > /opt/IDEALX/sbin/smbldap-groupmod -m "%u" "%g"</smbconfoption>
<smbconfoption name= "delete user from group script" > /opt/IDEALX/sbin/smbldap-groupmod -x "%u" "%g"</smbconfoption>
<smbconfoption name= "set primary group script" > /opt/IDEALX/sbin/smbldap-usermod -g "%g" "%u"</smbconfoption>
2005-03-12 22:34:38 +00:00
<smbconfoption name= "add machine script" > /usr/local/sbin/smbldap-useradd -w "%m"</smbconfoption>
<smbconfoption name= "logon script" > logon.bat</smbconfoption>
<smbconfoption name= "logon path" > \\%L\profiles\%U\%a</smbconfoption>
<smbconfoption name= "logon drive" > H:</smbconfoption>
<smbconfoption name= "logon home" > \\%L\%U</smbconfoption>
<smbconfoption name= "domain logons" > Yes</smbconfoption>
<smbconfoption name= "wins support" > Yes</smbconfoption>
<smbconfoption name= "ldap admin dn" > cn=Manager,dc=abmas,dc=biz</smbconfoption>
<smbconfoption name= "ldap group suffix" > ou=Groups</smbconfoption>
<smbconfoption name= "ldap idmap suffix" > ou=People</smbconfoption>
<smbconfoption name= "ldap machine suffix" > ou=People</smbconfoption>
<smbconfoption name= "ldap passwd sync" > Yes</smbconfoption>
<smbconfoption name= "ldap suffix" > ou=MEGANET2,dc=abmas,dc=biz</smbconfoption>
<smbconfoption name= "ldap ssl" > no</smbconfoption>
<smbconfoption name= "ldap user suffix" > ou=People</smbconfoption>
<smbconfoption name= "admin users" > root, "@Domain Admins"</smbconfoption>
<smbconfoption name= "printer admin" > "@Domain Admins"</smbconfoption>
<smbconfoption name= "force printername" > Yes</smbconfoption>
2005-06-13 00:48:46 +00:00
</smbconfblock>
</example>
2005-03-10 01:31:22 +00:00
2005-06-13 00:48:46 +00:00
<example id= "ch8smbconf2" >
2005-03-10 01:31:22 +00:00
<title > Samba Configuration File &smbmdash; smb.conf Part B</title>
2005-06-13 00:48:46 +00:00
<smbconfblock >
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[netlogon]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > Network logon service</smbconfoption>
<smbconfoption name= "path" > /data/samba/netlogon</smbconfoption>
<smbconfoption name= "write list" > "@Domain Admins"</smbconfoption>
<smbconfoption name= "guest ok" > Yes</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[profiles]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > Roaming Profile Share</smbconfoption>
<smbconfoption name= "path" > /data/samba/profiles/</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "profile acls" > Yes</smbconfoption>
<smbconfoption name= "veto files" > desktop.ini</smbconfoption>
<smbconfoption name= "browseable" > No</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[homes]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > Home Directories</smbconfoption>
<smbconfoption name= "valid users" > %S</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "create mask" > 0770</smbconfoption>
<smbconfoption name= "veto files" > desktop.ini</smbconfoption>
<smbconfoption name= "hide files" > desktop.ini</smbconfoption>
<smbconfoption name= "browseable" > No</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[software]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > Software for %a computers</smbconfoption>
<smbconfoption name= "path" > /data/samba/shares/software/%a</smbconfoption>
<smbconfoption name= "guest ok" > Yes</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[public]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > Public Files</smbconfoption>
<smbconfoption name= "path" > /data/samba/shares/public</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "guest ok" > Yes</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[PDF]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > Location of documents printed to PDFCreator printer</smbconfoption>
<smbconfoption name= "path" > /data/samba/shares/pdf</smbconfoption>
<smbconfoption name= "guest ok" > Yes</smbconfoption>
2005-06-13 00:48:46 +00:00
</smbconfblock>
</example>
2005-03-10 01:31:22 +00:00
2005-06-13 00:48:46 +00:00
<example id= "ch8smbconf3" >
2005-03-10 01:31:22 +00:00
<title > Samba Configuration File &smbmdash; smb.conf Part C</title>
2005-06-13 00:48:46 +00:00
<smbconfblock >
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[EVERYTHING]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > All shares</smbconfoption>
<smbconfoption name= "path" > /data/samba</smbconfoption>
<smbconfoption name= "valid users" > "@Domain Admins"</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[CDROM]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > CD-ROM on MASSIVE</smbconfoption>
<smbconfoption name= "path" > /mnt</smbconfoption>
<smbconfoption name= "guest ok" > Yes</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[print$]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > Printer Drivers Share</smbconfoption>
<smbconfoption name= "path" > /data/samba/drivers</smbconfoption>
<smbconfoption name= "write list" > root</smbconfoption>
<smbconfoption name= "browseable" > No</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[printers]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > All Printers</smbconfoption>
<smbconfoption name= "path" > /data/samba/spool</smbconfoption>
<smbconfoption name= "create mask" > 0644</smbconfoption>
<smbconfoption name= "printable" > Yes</smbconfoption>
<smbconfoption name= "browseable" > No</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[acct_hp8500]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > "Accounting Color Laser Printer"</smbconfoption>
<smbconfoption name= "path" > /data/samba/spool/private</smbconfoption>
2005-06-13 13:22:50 +00:00
<smbconfoption name= "valid users" > @acct, @acct_admin, @hr, "@Domain Admins",@Receptionist, dwayne, terri, danae, jerry</smbconfoption>
2005-03-12 22:34:38 +00:00
<smbconfoption name= "create mask" > 0644</smbconfoption>
<smbconfoption name= "printable" > Yes</smbconfoption>
<smbconfoption name= "copy" > printers</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[plotter]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "comment" > Engineering Plotter</smbconfoption>
<smbconfoption name= "path" > /data/samba/spool</smbconfoption>
<smbconfoption name= "create mask" > 0644</smbconfoption>
<smbconfoption name= "printable" > Yes</smbconfoption>
<smbconfoption name= "use client driver" > Yes</smbconfoption>
<smbconfoption name= "copy" > printers</smbconfoption>
2005-06-13 00:48:46 +00:00
</smbconfblock>
</example>
2005-03-10 01:31:22 +00:00
2005-06-13 00:48:46 +00:00
<example id= "ch8smbconf4" >
2005-03-10 01:31:22 +00:00
<title > Samba Configuration File &smbmdash; smb.conf Part D</title>
2005-06-13 00:48:46 +00:00
<smbconfblock >
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[APPS]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/Apps</smbconfoption>
<smbconfoption name= "force group" > "Domain Users"</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[ACCT]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/Accounting</smbconfoption>
<smbconfoption name= "valid users" > @acct, "@Domain Admins"</smbconfoption>
<smbconfoption name= "force group" > acct</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "create mask" > 0660</smbconfoption>
<smbconfoption name= "directory mask" > 0770</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[ACCT_ADMIN]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/Acct_Admin</smbconfoption>
2009-05-01 18:05:45 +02:00
<smbconfoption name= "valid users" > @"acct_admin"</smbconfoption>
2005-03-12 22:34:38 +00:00
<smbconfoption name= "force group" > acct_admin</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[HR_PR]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/HR_PR</smbconfoption>
<smbconfoption name= "valid users" > @hr, @acct_admin</smbconfoption>
<smbconfoption name= "force group" > hr</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[ENGR]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/Engr</smbconfoption>
<smbconfoption name= "valid users" > @engr, @receptionist, @truss, "@Domain Admins", cheri</smbconfoption>
<smbconfoption name= "force group" > engr</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "create mask" > 0770</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[DATA]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/DATA</smbconfoption>
<smbconfoption name= "valid users" > @engr, @receptionist, @truss, "@Domain Admins", cheri</smbconfoption>
<smbconfoption name= "force group" > engr</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "create mask" > 0770</smbconfoption>
<smbconfoption name= "copy" > engr</smbconfoption>
2005-06-13 00:48:46 +00:00
</smbconfblock>
</example>
2005-03-10 01:31:22 +00:00
2005-06-13 00:48:46 +00:00
<example id= "ch8smbconf5" >
2005-03-10 01:31:22 +00:00
<title > Samba Configuration File &smbmdash; smb.conf Part E</title>
2005-06-13 00:48:46 +00:00
<smbconfblock >
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[X]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/X</smbconfoption>
<smbconfoption name= "valid users" > @engr, @acct</smbconfoption>
<smbconfoption name= "force group" > engr</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "create mask" > 0770</smbconfoption>
<smbconfoption name= "copy" > engr</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[NETWORK]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/network</smbconfoption>
<smbconfoption name= "valid users" > "@Domain Users"</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "create mask" > 0770</smbconfoption>
<smbconfoption name= "guest ok" > Yes</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[UTILS]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/Utils</smbconfoption>
<smbconfoption name= "write list" > "@Domain Admins"</smbconfoption>
2005-03-10 01:31:22 +00:00
2005-03-13 18:25:08 +00:00
<smbconfsection name= "[SYS]" />
2005-03-12 22:34:38 +00:00
<smbconfoption name= "path" > /data/samba/shares/SYS</smbconfoption>
<smbconfoption name= "valid users" > chad</smbconfoption>
<smbconfoption name= "read only" > No</smbconfoption>
<smbconfoption name= "browseable" > No</smbconfoption>
2005-06-13 00:48:46 +00:00
</smbconfblock>
</example>
2005-03-10 01:31:22 +00:00
2005-03-09 07:59:06 +00:00
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > Qbasic</primary> </indexterm>
<indexterm > <primary > Rbase</primary> </indexterm>
<indexterm > <primary > drive letters</primary> </indexterm>
2005-03-09 07:59:06 +00:00
Most of these shares are only used by one company group, but they are required
because of some ancient Qbasic and Rbase applications were that written expecting
2005-03-10 07:36:23 +00:00
their own drive letters.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > rsync</primary> </indexterm>
<indexterm > <primary > rsyncd.conf</primary> </indexterm>
<indexterm > <primary > synchronize</primary> </indexterm>
2005-04-23 15:45:07 +00:00
Note: During the process of building the new server, I kept data files
2005-05-25 21:40:55 +00:00
up to date with the Novell server via use of <command > rsync</command> .
On a separate system (my workstation in fact), which could be rebooted
2005-04-23 15:45:07 +00:00
whenever necessary, I set up a mount point to the Novell server via
<command > ncpmount</command> . I then created a
<filename > rsyncd.conf</filename> to share that mount point out to my
new server, and synchronized once an hour. The script I used to synchronize
is shown in <link linkend= "sbersync" /> . The files exclusion list I used
is shown in <link linkend= "sbexcld" /> . The reason I had to have the
2005-05-25 21:40:55 +00:00
<command > rsync</command> daemon running on a system that could be
2005-04-23 15:45:07 +00:00
rebooted frequently is because <constant > ncpfs</constant>
2005-04-24 04:57:50 +00:00
(part of the MARS NetWare Emulation package) has a nasty habit of creating stale
2005-05-25 21:40:55 +00:00
mount points that cannot be recovered without a reboot. The reason for hourly
2005-04-23 15:45:07 +00:00
synchronization is because some part of the chain was very slow and
performance-heavy (whether <command > rsync</command> itself, the network,
2005-05-25 21:40:55 +00:00
or the Novell server, I am not sure, but it was probably the Novell server).
2005-03-09 07:59:06 +00:00
</para>
2005-04-23 15:45:07 +00:00
<example id= "sbersync" >
<title > Rsync Script</title>
<screen >
#!/bin/bash
# Part 1 - rsync the Novell directories to the new server
echo "#############################################"
echo "New sync operation starting at `date`"
if ! pgrep -fl '^rsync\> ; then
echo "Good, no rsync is running!"
echo "Synchronizing oink to BHPRO"
rsync -av --exclude-from=/root/excludes.txt
baa.corp:/BHPRO/SYS1/ /data/samba/shares/SYS1
retval=$?
[ ${retval} = 0 ] & & echo "Sync operation completed at `date`"
echo "Fixing permissions"
# I had a whole lot more permission-fixing stuff here. It got
# pared down as groups got moved over. The problem
# was that the way I was mounting the directory, everything
# was owned by the Novell administrator which translated to
# Root. This is also why I could only do one-way sync because
# I could not fix the ACLs on the Novell side.
find /data/samba/shares/Engr/ -perm +770 -exec chmod 770 {} \;
find /data/samba/shares/Engr/ ! -group engr -exec chgrp engr {} \;
else
# This rsync took ages and ages -- I had it set to run every hour but
# I needed a way to prevent it running into itself.
echo "Oh no, rsync is already running!"
echo "#############################################"
fi
</screen>
</example>
<example id= "sbexcld" >
<title > Rsync Files Exclusion List &smbmdash; <filename > /root/excludes.txt</filename> </title>
<screen >
/Acct/
/Apps/
/DATA/
/Engr/*.pc3
/Engr/plotter
/Engr/APPOLO/
/Engr/LIBRARY/
/Home/Accounting/
/Home/Angie/
/Home/AngieY/
/Home/Brandon/
/Home/Carl/
</screen>
</example>
2005-03-09 07:59:06 +00:00
<para >
2005-05-25 21:40:55 +00:00
After Samba was configured, I initialized the LDAP database. The first
thing I had to do was store the LDAP password in the Samba configuration by
2005-03-10 00:09:15 +00:00
issuing the command (as root):
2005-03-09 07:59:06 +00:00
<screen >
2005-03-10 00:09:15 +00:00
&rootprompt; smbpasswd -w verysecret
2005-03-09 07:59:06 +00:00
</screen>
2005-03-10 00:09:15 +00:00
where <quote > verysecret</quote> is replaced by the LDAP bind password.
2005-03-09 07:59:06 +00:00
</para>
2005-03-10 00:09:15 +00:00
<note > <para >
The Idealx smbldap-tools package can be configured using a script called
2005-05-02 06:26:19 +00:00
<command > configure.pl</command> that is provided as part of the tool. See <link linkend= "happy" />
2005-03-10 00:09:15 +00:00
for an example of its use. Many administrators, like Misty, choose to do this manually
2005-05-25 21:40:55 +00:00
so as to maintain greater awareness of how the tool-chain works and possibly to avoid
2005-06-13 15:29:53 +00:00
undesirable actions from occurring unnoticed.
2005-03-10 00:09:15 +00:00
</para> </note>
2005-03-09 07:59:06 +00:00
<para >
2005-05-25 21:40:55 +00:00
Now Samba was ready for use and it was time to configure the smbldap-tools. There are two
2005-03-10 00:09:15 +00:00
relevant files, which are usually put into the directory
<filename > /etc/smbldap-tools</filename> . The main file,
2005-03-10 01:31:22 +00:00
<filename > smbldap.conf</filename> is shown in <link linkend= "ch8ideal" /> .
</para>
<example id= "ch8ideal" >
<title > Idealx smbldap-tools Control File &smbmdash; Part A</title>
2005-03-09 07:59:06 +00:00
<screen >
2005-03-10 01:31:22 +00:00
#########
#
# located in /etc/smbldap-tools/smbldap.conf
#
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
#
# General Configuration
#
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
# Put your own SID
# to obtain this number do: net getlocalsid
SID="S-1-5-21-725326080-1709766072-2910717368"
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
#
# LDAP Configuration
#
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
# Notes: to use to dual ldap servers backend for Samba, you must patch
# Samba with the dual-head patch from IDEALX. If not using this patch
# just use the same server for slaveLDAP and masterLDAP.
# Those two servers declarations can also be used when you have
# . one master LDAP server where all writing operations must be done
# . one slave LDAP server where all reading operations must be done
# (typically a replication directory)
# Ex: slaveLDAP=127.0.0.1
slaveLDAP="127.0.0.1"
slavePort="389"
# Master LDAP : needed for write operations
# Ex: masterLDAP=127.0.0.1
masterLDAP="127.0.0.1"
masterPort="389"
# Use TLS for LDAP
# If set to 1, this option will use start_tls for connection
# (you should also used the port 389)
ldapTLS="0"
# How to verify the server's certificate (none, optional or require)
# see "man Net::LDAP" in start_tls section for more details
verify=""
2005-03-10 01:31:22 +00:00
</screen>
</example>
2005-03-09 07:59:06 +00:00
2005-03-10 01:31:22 +00:00
<example id= "ch8ideal2" >
<title > Idealx smbldap-tools Control File &smbmdash; Part B</title>
<screen >
2005-03-09 07:59:06 +00:00
# CA certificate
# see "man Net::LDAP" in start_tls section for more details
cafile=""
certificate to use to connect to the ldap server
# see "man Net::LDAP" in start_tls section for more details
clientcert=""
# key certificate to use to connect to the ldap server
# see "man Net::LDAP" in start_tls section for more details
clientkey=""
# LDAP Suffix
# Ex: suffix=dc=IDEALX,dc=ORG
2005-03-10 01:31:22 +00:00
suffix="ou=MEGANET2,dc=abmas,dc=biz"
2005-03-09 07:59:06 +00:00
# Where are stored Users
# Ex: usersdn="ou=Users,dc=IDEALX,dc=ORG"
usersdn="ou=People,${suffix}"
# Where are stored Computers
# Ex: computersdn="ou=Computers,dc=IDEALX,dc=ORG"
2005-03-16 20:24:47 +00:00
computersdn="ou=People,${suffix}"
2005-03-09 07:59:06 +00:00
# Where are stored Groups
# Ex groupsdn="ou=Groups,dc=IDEALX,dc=ORG"
groupsdn="ou=Groups,${suffix}"
2005-03-16 20:24:47 +00:00
2005-07-04 19:37:04 +00:00
# Where are stored Idmap entries
# (used if samba is a domain member server)
2005-03-09 07:59:06 +00:00
# Ex groupsdn="ou=Idmap,dc=IDEALX,dc=ORG"
2005-03-16 20:24:47 +00:00
idmapdn="ou=Idmap,${suffix}"
2005-03-09 07:59:06 +00:00
# Where to store next uidNumber and gidNumber available
2005-07-04 19:37:04 +00:00
sambaUnixIdPooldn="sambaDomainName=MEGANET2,${suffix}"
2005-03-09 07:59:06 +00:00
# Default scope Used
scope="sub"
2005-03-10 01:31:22 +00:00
</screen>
</example>
2005-03-09 07:59:06 +00:00
2005-03-10 01:31:22 +00:00
<example id= "ch8ideal3" >
<title > Idealx smbldap-tools Control File &smbmdash; Part C</title>
<screen >
2005-03-09 07:59:06 +00:00
# Unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA)
2005-03-16 20:24:47 +00:00
hash_encrypt="MD5"
2005-03-09 07:59:06 +00:00
# if hash_encrypt is set to CRYPT, you may set a salt format.
# default is "%s", but many systems will generate MD5 hashed
# passwords if you use "$1$%.8s". This parameter is optional!
crypt_salt_format="%s"
2005-03-10 00:09:15 +00:00
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
#
# Unix Accounts Configuration
#
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
# Login defs
# Default Login Shell
# Ex: userLoginShell="/bin/bash"
userLoginShell="/bin/false"
# Home directory
# Ex: userHome="/home/%U"
userHome="/home/%U"
# Gecos
userGecos="Samba User"
# Default User (POSIX and Samba) GID
defaultUserGid="513"
# Default Computer (Samba) GID
defaultComputerGid="515"
# Skel dir
skeletonDir="/etc/skel"
2005-07-04 19:37:04 +00:00
# Default password validation time (time in days) Comment the next
# line if you don't want password to be enable for
# defaultMaxPasswordAge days (be careful to the sambaPwdMustChange
# attribute's value)
2005-03-09 07:59:06 +00:00
defaultMaxPasswordAge="45"
2005-03-10 01:31:22 +00:00
</screen>
</example>
2005-03-09 07:59:06 +00:00
2005-03-10 01:31:22 +00:00
<example id= "ch8ideal4" >
<title > Idealx smbldap-tools Control File &smbmdash; Part D</title>
<screen >
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
#
# SAMBA Configuration
#
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
# The UNC path to home drives location (%U username substitution)
# Ex: \\My-PDC-netbios-name\homes\%U
2005-07-04 19:37:04 +00:00
# Just set it to a null string if you want to use the smb.conf
# 'logon home' directive and/or disable roaming profiles
2005-03-09 07:59:06 +00:00
userSmbHome=""
# The UNC path to profiles locations (%U username substitution)
# Ex: \\My-PDC-netbios-name\profiles\%U
2005-07-04 19:37:04 +00:00
# Just set it to a null string if you want to use the smb.conf
# 'logon path' directive and/or disable roaming profiles
2005-03-09 07:59:06 +00:00
userProfile=""
# The default Home Drive Letter mapping
# (will be automatically mapped at logon time if home directory exist)
# Ex: H: for H:
userHomeDrive=""
# The default user netlogon script name (%U username substitution)
# if not used, will be automatically username.cmd
2005-04-24 04:57:50 +00:00
# make sure script file is edited under DOS
2005-03-09 07:59:06 +00:00
# Ex: %U.cmd
2005-04-24 04:57:50 +00:00
# userScript="startup.cmd" # make sure script file is edited under DOS
2005-03-09 07:59:06 +00:00
userScript=""
# Domain appended to the users "mail"-attribute
# when smbldap-useradd -M is used
2005-03-10 00:09:15 +00:00
mailDomain="abmas.org"
2005-03-09 07:59:06 +00:00
2005-07-04 19:37:04 +00:00
######################################################################
2005-03-09 07:59:06 +00:00
#
# SMBLDAP-TOOLS Configuration (default are ok for a RedHat)
#
2005-07-04 19:37:04 +00:00
######################################################################
# Allows not to use smbpasswd
# (if with_smbpasswd == 0 in smbldap_conf.pm) but
2005-03-09 07:59:06 +00:00
# prefer Crypt::SmbHash library
with_smbpasswd="0"
smbpasswd="/usr/bin/smbpasswd"
</screen>
2005-03-10 01:31:22 +00:00
</example>
2005-03-09 07:59:06 +00:00
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > TLS</primary> </indexterm>
2005-05-25 21:40:55 +00:00
Note: I chose not to take advantage of the TLS capability of this.
Eventually I may go back and tweak it. Also, I chose not to take advantage
2005-03-09 07:59:06 +00:00
of the master/slave configuration as I heard horror stories that it was
2005-03-10 00:09:15 +00:00
unstable. My slave servers are replicas only.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
The <filename > /etc/smbldap-tools/smbldap_bind.conf</filename> file is shown here:
2005-03-09 07:59:06 +00:00
<screen >
# smbldap_bind.conf
2005-03-10 00:09:15 +00:00
#
# This file simply tells smbldap-tools how to bind to your LDAP server.
# It has to be a DN with full write access to the Samba portion of
# the database.
2005-03-09 07:59:06 +00:00
############################
# Credential Configuration #
############################
2005-05-25 21:40:55 +00:00
# Notes: you can specify two different configurations if you use a
2005-03-09 07:59:06 +00:00
# master ldap for writing access and a slave ldap server for reading access
# By default, we will use the same DN (so it will work for standard Samba
# release)
2005-03-10 00:09:15 +00:00
slaveDN="cn=Manager,dc=abmas,dc=biz"
2005-03-09 07:59:06 +00:00
slavePw="verysecret"
2005-03-10 00:09:15 +00:00
masterDN="cn=Manager,dc=abmas,dc=biz"
masterPw="verysecret"
2005-03-09 07:59:06 +00:00
</screen>
</para>
<para >
2005-05-25 21:40:55 +00:00
The next step was to run the <command > smbldap-populate</command> command, which populates
2005-03-10 00:09:15 +00:00
the LDAP tree with the appropriate default users, groups, and UID and GID pools.
2005-05-25 21:40:55 +00:00
It creates a user called Administrator with UID=0 and GID=0 matching the
2005-06-13 15:29:53 +00:00
Domain Admins group. This is fine because you can still log on as root to a Windows system,
2005-05-25 21:40:55 +00:00
but it will break cached credentials if you need to log on as the administrator
to a system that is not on the network.
2005-03-10 00:09:15 +00:00
</para>
<para >
2005-05-25 21:40:55 +00:00
After the LDAP database has been preloaded, it is prudent to validate that the
2005-03-10 00:09:15 +00:00
information needed is in the LDAP directory. This can be done done by restarting
the LDAP server, then performing an LDAP search by executing:
<screen >
&rootprompt; ldapsearch -W -x -b "dc=abmas,dc=biz"\
-D "cn=Manager,dc=abmas,dc=biz" \
"(Objectclass=*)"
Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base < dc=abmas,dc=biz> with scope sub
# filter: (ObjectClass=*)
# requesting: ALL
#
# abmas.biz
dn: dc=abmas,dc=biz
objectClass: dcObject
objectClass: organization
o: abmas
dc: abmas
# People, abmas.biz
dn: ou=People,dc=abmas,dc=biz
objectClass: organizationalUnit
ou: People
# Groups, abmas.biz
dn: ou=Groups,dc=abmas,dc=biz
objectClass: organizationalUnit
ou: Groups
# Idmap, abmas.biz
dn: ou=Idmap,dc=abmas,dc=biz
objectClass: organizationalUnit
ou: Idmap
...
</screen>
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > Windows</primary> </indexterm>
<indexterm > <primary > POSIX</primary> </indexterm>
<indexterm > <primary > smbldap-groupadd</primary> </indexterm>
<indexterm > <primary > RID</primary> </indexterm>
<indexterm > <primary > sambaGroupMapping</primary> </indexterm>
2005-05-25 21:40:55 +00:00
With the LDAP directory now initialized, it was time to create the Windows and POSIX
2005-03-10 00:09:15 +00:00
(UNIX) group accounts as well as the mappings from Windows groups to UNIX groups.
2005-05-25 21:40:55 +00:00
The easiest way to do this was to use <command > smbldap-groupadd</command> command.
It creates the group with the posixGroup and sambaGroupMapping attributes, a
unique GID, and an automatically determined RID. I learned the hard way not to
2005-03-10 00:09:15 +00:00
try to do this by hand.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > group mapping</primary> </indexterm>
<indexterm > <primary > smbldap-groupmod</primary> </indexterm>
<indexterm > <primary > memberUID</primary> </indexterm>
2005-03-09 07:59:06 +00:00
After I had my group mappings in place, I added users to the groups (the users
2005-03-10 00:09:15 +00:00
don't really have to exist yet). I used the <command > smbldap-groupmod</command>
command to accomplish this. It can also be done manually by adding memberUID
2005-03-10 07:36:23 +00:00
attributes to the group entries in LDAP.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > sambaSamAccount</primary> </indexterm>
<indexterm > <primary > posixAccount</primary> </indexterm>
<indexterm > <primary > smbldap-usermod</primary> </indexterm>
2005-03-09 07:59:06 +00:00
The most monumental task of all was adding the sambaSamAccount information to each
2005-05-25 21:40:55 +00:00
already existent posixAccount entry. I did it one at a time as I moved people onto
2005-03-10 00:09:15 +00:00
the new server, by issuing the command:
<screen >
&rootprompt; smbldap-usermod -a -P username
</screen>
2005-03-10 07:36:23 +00:00
<indexterm > <primary > NetWare</primary> </indexterm>
<indexterm > <primary > LDIF</primary> </indexterm>
<indexterm > <primary > slapcat</primary> </indexterm>
2005-05-25 21:40:55 +00:00
I completed that step for every user after asking the person what his or her current
NetWare password was. The wiser way to have done it would probably have been to dump the
2005-03-10 00:09:15 +00:00
entire database to an LDIF file. This can be done by executing:
<screen >
&rootprompt; slapcat > somefile.ldif
</screen>
2005-03-10 07:36:23 +00:00
<indexterm > <primary > Perl</primary> </indexterm>
<indexterm > <primary > objectClass</primary> </indexterm>
2005-03-10 00:09:15 +00:00
Then update the LDIF file created by using a Perl script to parse and add the
appropriate attributes and objectClasses to each entry, followed by re-importing
the entire database into the LDAP directory.
</para>
<para >
Rebuilding of the LDAP directory can be done as follows:
<screen >
&rootprompt; rcldap stop
&rootprompt; cd /data/ldap
&rootprompt; rm *bdb _* log*
&rootprompt; su - ldap -c "slapadd -l somefile.ldif"
&rootprompt; rcldap start
</screen>
This can be done at any time and for any reason, with no harm to the database.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-05-25 21:40:55 +00:00
I first added a test user, of course. The LDIF for this test user looks like
2005-03-09 07:59:06 +00:00
this, to give you an idea:
<screen >
2005-03-10 00:09:15 +00:00
# Entry 1: cn=Test User,ou=people,ou=corp,dc=abmas,dc=biz
dn:cn=Test User,ou=people,ou=corp,dc=abmas,dc=biz
2005-03-09 07:59:06 +00:00
cn: Test User
gecos: Test User
gidNumber: 513
givenName: Test
homeDirectory: /home/test.user
homePhone: 555
l: Somewhere
l: ST
mail: test.user
o: Corp
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: sambaSamAccount
postalCode: 12345
sn: User
street: 10 Some St.
uid: test.user
uidNumber: 1074
sambaLogonTime: 0
sambaLogoffTime: 2147483647
sambaKickoffTime: 2147483647
sambaPwdCanChange: 0
displayName: Samba User
sambaSID: S-1-5-21-725326080-1709766072-2910717368-3148
sambaLMPassword: 9D29C287C58448F9AAD3B435B51404EE
sambaAcctFlags: [U]
sambaNTPassword: D062088E99C95E37D7702287BB35E770
sambaPwdLastSet: 1102537694
sambaPwdMustChange: 1106425694
userPassword: {SSHA}UzFZ2VxRGdwUueLnTGtsTBtnsvMO1oj8
loginShell: /bin/false
</screen>
</para>
<para >
2005-03-10 01:31:22 +00:00
Then I went over to a spare Windows NT machine and joined it to the MEGANET2 domain.
2005-03-10 07:36:23 +00:00
It worked, and the machine's account entry under ou=Computers looks like this:
2005-03-09 07:59:06 +00:00
<screen >
2005-03-10 01:31:22 +00:00
dn:uid=w2kengrspare$,ou=Computers,ou=MEGANET2,dc=abmas,dc=biz
2005-03-09 07:59:06 +00:00
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: sambaSamAccount
cn: w2kengrspare$
sn: w2kengrspare$
uid: w2kengrspare$
uidNumber: 1104
gidNumber: 515
homeDirectory: /dev/null
loginShell: /bin/false
description: Computer
gecos: Computer
sambaSID: S-1-5-21-725326080-1709766072-2910717368-3208
sambaPrimaryGroupSID: S-1-5-21-725326080-1709766072-2910717368-2031
displayName: W2KENGRSPARE$
sambaPwdCanChange: 1103149236
sambaPwdMustChange: 2147483647
sambaNTPassword: CA199C45CB6737035DB6D9D9F6CD1834
sambaPwdLastSet: 1103149236
sambaAcctFlags: [W ]
</screen>
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > netlogon</primary> </indexterm>
2005-06-13 15:29:53 +00:00
So now I could log on with a test user from the machine w2kengrspare. It was all well and
2005-05-25 21:40:55 +00:00
good, but that user was in no groups yet and so had pretty boring access. I fixed that
2005-03-10 00:09:15 +00:00
by writing the login script! To write the login script, I used
2005-05-25 21:40:55 +00:00
<ulink url= "http://www.kixtart.org" > Kixtart</ulink> because it will work
2005-03-10 00:09:15 +00:00
with every architecture of Windows, has an active and helpful user base, and was both
easier to learn and more powerful than the standard netlogon scripts I have seen.
I also did not have to do a logon script per user or per group.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > Kixtart</primary> </indexterm>
2005-05-25 21:40:55 +00:00
I downloaded Kixtart and put the following files in my netlogon share:
2005-03-09 07:59:06 +00:00
<screen >
KIX32.EXE
KX32.dll
2005-03-10 00:09:15 +00:00
KX95.dll < -- Not needed unless you are running Win9x clients.
kx16.dll < -- Probably not needed unless you are running DOS clients.
kxrpc.exe < -- Probably useless as it has to run on the server and can
only be run on NT. It's for Windows 95 to become group-aware.
We can get around the need.
2005-03-09 07:59:06 +00:00
</screen>
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > logon.kix</primary> </indexterm>
2005-03-10 01:31:22 +00:00
I then wrote the <filename > logon.kix</filename> file that is shown in
<link linkend= "ch8kix" /> . I chose to keep it all in one file, but it
can be split up and linked via include directives.
</para>
<example id= "ch8kix" >
2005-04-24 04:57:50 +00:00
<title > Kixtart Control File &smbmdash; File: logon.kix</title>
2005-03-14 18:50:40 +00:00
<screen >
; This script just calls the other scripts.
; First we want to get things done for everyone.
; Second, we do first-time login stuff.
; Third, we go through the group-oriented scripts one at a time.
; We want to check for group membership here to avoid the overhead of running
; scripts which don't apply.
call "\\massive\netlogon\scripts\main.kix"
call "\\massive\netlogon\scripts\setup.kix"
IF INGROUP("MEGANET2\ACCT")
call "scripts\acct.kix"
ENDIF
IF INGROUP("MEGANET2\ENGR","MEGANET2\RECEPTIONIST")
call "\\massive\netlogon\scripts\engr.kix"
ENDIF
IF INGROUP("MEGANET2\FURN")
call "\\massive\netlogon\scripts\furn.kix"
ENDIF
IF INGROUP("MEGANET2\TRUSS")
call "\\massive\netlogon\scripts\truss.kix"
ENDIF
</screen>
</example>
<example id= "ch8kix2" >
2005-04-24 04:57:50 +00:00
<title > Kixtart Control File &smbmdash; File: main.kix</title>
2005-03-09 07:59:06 +00:00
<screen >
break on
2005-03-14 18:50:40 +00:00
; Choose whether to hide the login window or not
IF INGROUP("MEGANET2\Domain Admins")
USE Z: \\massive\everything
SETCONSOLE("show")
ELSE
; Nobody cares about seeing the login script except admins
SETCONSOLE("hide")
2005-03-09 07:59:06 +00:00
ENDIF
2005-03-14 18:50:40 +00:00
; Delete all previously connected shares
USE * /delete
2005-03-09 07:59:06 +00:00
SETTITLE("Logging on @USERID to @LDOMAIN at @TIME")
; Set the time on the workstation
2005-03-14 18:50:40 +00:00
$Timeserver = "\\massive"
2005-03-09 07:59:06 +00:00
Settime $TimeServer
2005-03-14 18:50:40 +00:00
; Map the home directory
2005-03-09 07:59:06 +00:00
USE H: @HOMESHR ; connect to user's home share
IF @ERROR = 0
2005-03-14 18:50:40 +00:00
2005-03-09 07:59:06 +00:00
H:
CD @HOMEDIR ; change directory to user's home directory
ENDIF
2005-03-14 18:50:40 +00:00
; Everyone gets the N drive
USE N: \\massive\network
</screen>
</example>
<example id= "ch8kix3" >
2005-04-24 04:57:50 +00:00
<title > Kixtart Control File &smbmdash; File: setup.kix, Part A</title>
2005-03-14 18:50:40 +00:00
<screen >
; My setup.kix is where all of the redirection stuff happens. Note that with
2005-04-24 04:57:50 +00:00
; the use of registry keys, this only happens the first time they log in ,or if
2005-03-14 18:50:40 +00:00
; I delete the pertinent registry keys which triggers it to happen again:
2005-04-24 04:57:50 +00:00
; Check to see if we have written the abmas sub-key before
$RETURNCODE = EXISTKEY("HKEY_CURRENT_USER\abmas")
2005-03-14 18:50:40 +00:00
IF NOT $RETURNCODE = 0
2005-04-24 04:57:50 +00:00
; Add key for abmas-specific things on the first login
ADDKEY("HKEY_CURRENT_USER\abmas")
2005-03-14 18:50:40 +00:00
; The following key gets deleted at the end of the first login
2005-04-24 04:57:50 +00:00
ADDKEY("HKEY_CURRENT_USER\abmas\FIRST_LOGIN")
2005-03-14 18:50:40 +00:00
ENDIF
2005-03-09 07:59:06 +00:00
; People with laptops need My Documents to be in their profile. People with
; desktops can have My Documents redirected to their home directory to avoid
; long delays with logging out and out-of-sync files.
; Check to see if this is the first login -- doesn't make sense to do this
; at the very first login
2005-04-24 04:57:50 +00:00
$RETURNCODE = EXISTKEY("HKEY_CURRENT_USER\abmas\FIRST_LOGIN")
2005-03-09 07:59:06 +00:00
IF NOT $RETURNCODE = 0
2005-03-14 18:50:40 +00:00
; We don't want to do this stuff for people with laptops or people in the FURN
; group. (They store their profiles in a different server)
IF NOT INGROUP("MASSIVE\Laptop","MASSIVE\FURN")
2005-04-24 04:57:50 +00:00
$RETURNCODE=EXISTKEY("HKEY_CURRENT_USER\abmas\profile_copied")
2005-03-14 18:50:40 +00:00
; A crude way to tell what OS our profile is for and copy the "My Documents"
; to the redirected folder on the server. It works because the profiles
; are stored as \\server\profiles\user\architecture
2005-03-09 07:59:06 +00:00
IF NOT $RETURNCODE = 0
2005-03-14 18:50:40 +00:00
IF EXIST("\\massive\profiles\@userID\WinXP")
copy "\\massive\profiles\@userID\WinXP\My Documents\*"
"\\massive\@userID\"
2005-03-09 07:59:06 +00:00
ENDIF
2005-03-14 18:50:40 +00:00
IF EXIST("\\massive\profiles\@userID\Win2K")
copy "\\massive\profiles\@userID\Win2K\My Documents\*"
"\\massive\@userID\"
2005-03-09 07:59:06 +00:00
ENDIF
2005-03-14 18:50:40 +00:00
IF EXIST("\\massive\profiles\@userID\WinNT")
copy "\\massive\profiles\@userID\WinNT\My Documents\*"
"\\massive\@userID\"
2005-03-09 07:59:06 +00:00
ENDIF
2005-03-10 01:31:22 +00:00
</screen>
</example>
2005-03-14 18:50:40 +00:00
<example id= "ch8kix3b" >
2005-04-24 04:57:50 +00:00
<title > Kixtart Control File &smbmdash; File: setup.kix, Part B</title>
2005-03-10 01:31:22 +00:00
<screen >
2005-03-14 18:50:40 +00:00
; Now we will write the registry values to redirect the locations of "My
Documents"
; and other folders.
2005-04-24 04:57:50 +00:00
ADDKEY("HKEY_CURRENT_USER\abmas\profile_copied")
2005-03-14 18:50:40 +00:00
WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Explorer\User
Shell Folders", "Personal","\\massive\@userID","REG_SZ")
WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Explorer\User
Shell Folders", "My Pictures", "\\massive\@userID\My Pictures", "REG_SZ")
IF @PRODUCTTYPE="Windows 2000 Professional" or @PRODUCTTYPE="Windows XP
Professional"
WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Explorer\User
Shell Folders", "My Videos", "\\massive\@userID\My Videos", "REG_SZ")
WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Explorer\User
Shell Folders", "My Music", "\\massive\@userID\My Music", "REG_SZ")
WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Explorer\User
Shell Folders", "My eBooks", "\\massive\@userID\My eBooks", "REG_SZ")
2005-03-09 07:59:06 +00:00
ENDIF
ENDIF
ENDIF
2005-04-24 04:57:50 +00:00
; Now we will delete the FIRST_LOGIN sub-key that we made before.
; Note - to run this script again you will want to delete the HKCU\abmas
; sub-key, log out, and log back in.
$RETURNVALUE = EXISTKEY("HKEY_CURRENT_USER\abmas\FIRST_LOGIN")
2005-03-14 18:50:40 +00:00
IF $RETURNVALUE = 0
2005-04-24 04:57:50 +00:00
DELKEY("HKEY_CURRENT_USER\abmas\FIRST_LOGIN")
2005-03-09 07:59:06 +00:00
ENDIF
2005-03-14 18:50:40 +00:00
</screen>
</example>
2005-03-09 07:59:06 +00:00
2005-03-14 18:50:40 +00:00
<example id= "ch8kix4" >
2005-04-24 04:57:50 +00:00
<title > Kixtart Control File &smbmdash; File: acct.kix</title>
2005-03-14 18:50:40 +00:00
<screen >
; And here is one group-oriented script to show what can be
; done that way: acct.kix:
2005-03-09 07:59:06 +00:00
2005-03-10 01:31:22 +00:00
IF INGROUP("MASSIVE\Acct_Admin","MASSIVE\HR")
USE I: \\MEGANET2\HR_PR
2005-03-09 07:59:06 +00:00
ENDIF
; Set up printer
2005-03-14 18:50:40 +00:00
$RETURNVALUE = existkey("HKEY_CURRENT_USER\Printers\,,massive,acct_hp8500")
2005-03-09 07:59:06 +00:00
IF NOT $RETURNVALUE = 0
2005-03-14 18:50:40 +00:00
ADDPRINTERCONNECTION("\\massive\acct_hp8500")
SETDEFAULTPRINTER("\\massive\acct_hp8500")
2005-03-09 07:59:06 +00:00
ENDIF
; Set up drive mappings
2005-03-14 18:50:40 +00:00
USE M: \\massive\ACCT
IF INGROUP("MEGANET2\ABRA")
USE T: \\trussrv\abra
2005-03-09 07:59:06 +00:00
ENDIF
2005-03-10 01:31:22 +00:00
</screen>
</example>
2005-03-09 07:59:06 +00:00
<para >
2005-05-25 21:40:55 +00:00
As you can see in the script, I redirected the My Documents to the user's home
share if he or she were not in the Laptop group. I also added printers on a
group-by-group basis, and if applicable I set the group printer. For this to
2005-03-09 07:59:06 +00:00
be effective, the print drivers must be installed on the Samba server in the
2005-04-24 04:57:50 +00:00
<filename > [print$]</filename> share. Ample documentation exists about how to
2005-05-25 21:40:55 +00:00
do that, so it is not covered here.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-05-25 21:40:55 +00:00
I call this script via the logon.bat script in the [netlogon] directory:
2005-03-09 07:59:06 +00:00
<screen >
\\corpsrv\netlogon\kix32 \\corpsrv\netlogon\logon.kix /f
</screen>
I only had to fully qualify the paths for Windows 9x, as Windows NT and
greater automatically add [NETLOGON] to the path.
</para>
<para >
Also of note for Win9x is that the drive mappings and printer setup will not
2005-05-25 21:40:55 +00:00
work because they rely on RPC. You merely have to put the appropriate settings
2005-04-24 04:57:50 +00:00
into the <filename > c:\autoexec.bat</filename> file or map the drives manually.
2005-05-25 21:40:55 +00:00
One option is to check the OS as part of the Kixtart script, and if it
is Win9x and is the first login, copy a premade
2005-04-24 04:57:50 +00:00
<filename > autoexec.bat</filename> to the <filename > C:</filename> drive. I
2005-06-13 15:29:53 +00:00
have only three such machines, and one is going away in the very near future,
2005-04-24 04:57:50 +00:00
so it was easier to do it by hand.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-03-10 07:36:23 +00:00
<indexterm > <primary > upgrade</primary> </indexterm>
2005-03-09 07:59:06 +00:00
At this point I was able to add the users. This is the part that really falls
2005-04-23 15:45:07 +00:00
into upgrade. I moved the users over one group at a time, starting with the
2005-03-09 07:59:06 +00:00
people who used the least amount of resources on the network. With each group
2005-05-25 21:40:55 +00:00
that I moved, I first logged on as a standard user in that group and took
careful note of the environment, mainly the printers he or she used, the PATH,
and what network resources he or she had access to (most importantly, which ones
the user actually needed access to).
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-05-25 21:40:55 +00:00
I then added the user's SambaSamAccount information as mentioned earlier,
2005-03-09 07:59:06 +00:00
and join the computer to the domain. The very first thing I had to do was to
copy the user's profile to the new server. This was very important, and I really
struggled with the most effective way to do it. Here is the method that worked
for every one of my users on Windows NT, 2000, and XP:
</para>
<procedure >
<step > <para >
Log in as the user on the domain. This creates the local copy
2005-05-25 21:40:55 +00:00
of the user's profile and copies it to the server as he or she logs out.
2005-03-09 07:59:06 +00:00
</para> </step>
<step > <para >
2005-03-10 00:09:15 +00:00
Reboot the computer and log in as the local machine administrator.
2005-03-09 07:59:06 +00:00
</para> </step>
<step > <para >
Right-click My Computer, click Properties, and navigate to the
2005-03-10 00:09:15 +00:00
user profiles tab (varies per version of Windows).
2005-03-09 07:59:06 +00:00
</para> </step>
<step > <para >
2005-03-10 00:09:15 +00:00
Select the user's local profile <constant > (COMPUTERNAME\username)</constant> ,
2005-03-10 01:31:22 +00:00
and click the <command > Copy To</command> button.
2005-03-09 07:59:06 +00:00
</para> </step>
<step > <para >
2005-03-10 00:09:15 +00:00
In the next dialog, copy it directly to the profiles share on the
2005-07-04 19:20:02 +00:00
Samba server (in my case \\PDCname\profiles\user\< architecture> .
You will have had to make a connection to the share as that
2005-05-25 21:40:55 +00:00
user (e.g., Windows Explorer type \\PDCname\profiles\username).
2005-03-09 07:59:06 +00:00
</para> </step>
<step > <para >
When the copy is complete (it can take a while) log out, and log back in
2005-05-25 21:40:55 +00:00
as the user. All of his or her settings and all contents of My Documents,
2005-03-09 07:59:06 +00:00
Favorites, and the registry should have been copied successfully.
</para> </step>
<step > <para >
2005-05-25 21:40:55 +00:00
If it doesn't look right (the dead giveaway is the desktop background),
2005-03-10 07:36:23 +00:00
shut down the computer without logging out (power cycle) and try logging
2005-03-09 07:59:06 +00:00
in as the user again. If it still doesn't work, repeat the steps above.
I only had to ever repeat it once.
</para> </step>
</procedure>
<para >
2005-05-25 21:40:55 +00:00
Words to the Wise:
2005-03-09 07:59:06 +00:00
</para>
<itemizedlist >
<listitem > <para >
2005-05-25 21:40:55 +00:00
If the user was anything other than a standard user on his or her system
before, you will save yourself some headaches by giving him or her identical
permissions (on the local machine) as his or her domain account <emphasis > before</emphasis>
copying the profile over. Do this through the User Administrator
2005-03-09 07:59:06 +00:00
in the Control Panel, after joining the computer to the domain and
2005-05-25 21:40:55 +00:00
before logging on as that user for the first time. Otherwise the user will
have trouble with permissions on his or her registry keys.
2005-03-09 07:59:06 +00:00
</para> </listitem>
<listitem > <para >
If any application was installed for the user only, rather than for
the entire system, it will probably not work without being reinstalled.
</para> </listitem>
</itemizedlist>
<para >
After all these steps are accomplished, only cleanup details are left. Make sure user's
2005-04-24 04:57:50 +00:00
shortcuts and Network Places point to the appropriate place on the new server, check
2005-03-09 07:59:06 +00:00
the important applications to be sure they work as expected and troubleshoot any problems
2005-05-25 21:40:55 +00:00
that might arise, and check to be sure the user's printers are present and working. By the
way, if there are any network printers installed as system printers (the Novell way),
2005-03-09 07:59:06 +00:00
you will need to log in as a local administrator and delete them.
</para>
<para >
2005-05-25 21:40:55 +00:00
For my non-laptop systems, I would then log in and out a couple times as the user
to be sure that his or her registry settings were modified, and then I was finished.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-05-25 21:40:55 +00:00
Some compatibility issues that cropped up included the following:
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-05-25 21:40:55 +00:00
Blackberry client: It did not like having its registry settings moved around
and so had to be reinstalled. Also, it needed write permissions to a portion of
2005-03-09 07:59:06 +00:00
the hard drive, and I had to give it those manually on the one system where
this was an issue.
</para>
2005-03-10 00:09:15 +00:00
<para >
2005-05-25 21:40:55 +00:00
CAMedia: Digital camera software for Canon cameras caused all kinds of trouble
2005-03-10 00:09:15 +00:00
with the registry. I had to use the Run as service to open the registry of
2005-03-09 07:59:06 +00:00
the local user while logged in as the domain user, and give the domain user
the appropriate permissions to some registry keys, then export that portion
2005-05-25 21:40:55 +00:00
of the registry to a file. Then, as the domain user, I had to import that file
2005-03-09 07:59:06 +00:00
into the registry.
</para>
<para >
2005-05-25 21:40:55 +00:00
Crystal Reports version 7: More registry problems that were solved by recopying
2005-03-09 07:59:06 +00:00
the user's profile.
</para>
<para >
2005-05-25 21:40:55 +00:00
Printing from legacy applications: I found out that Novell sends its jobs to
the printer in a raw format. CUPS sends them in PostScript by default. I had
2005-03-10 07:36:23 +00:00
to make a second printer definition for one printer and tell CUPS specifically
2005-05-25 21:40:55 +00:00
to send raw data to the printer, then assign this printer to the LPT port with
2005-04-24 04:57:50 +00:00
Kixtart's version of the net use command.
2005-03-09 07:59:06 +00:00
</para>
<para >
These were all eventually solved by elbow grease, queries to the Samba mailing
2005-03-10 00:09:15 +00:00
list and others, and diligence. The complete migration took about 5 weeks.
2005-05-25 21:40:55 +00:00
My userbase is relatively small but includes multiple versions of Windows,
2005-03-09 07:59:06 +00:00
multiple Linux member servers, a mechanized saw, a pen plotter, and legacy
applications written in Qbasic and R:Base, just to name a few. I actually
ended up making some of these applications work better (or work again, as
2005-03-10 07:36:23 +00:00
some of them had stopped functioning on the old server) because as part of
2005-03-09 07:59:06 +00:00
the process I had to find out how things were supposed to work.
</para>
<para >
The one thing I have not been able to get working is a very old database that
2005-05-25 21:40:55 +00:00
we had around for reference purposes; it uses Novell's Btrieve engine.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-05-25 21:40:55 +00:00
As the resources compare, I went from 95 percent disk usage to just around 10 percent.
I went from a very high load on the server to an average load of between one
and two runnable processes on the server. I have improved the security and
2005-03-10 00:09:15 +00:00
robustness of the system. I have also implemented
2005-05-25 21:40:55 +00:00
<ulink url= "http://www.clamav.net" > ClamAV</ulink> antivirus software,
which scans the entire Samba server for viruses every 2 hours and
2005-03-10 00:09:15 +00:00
quarantines them. I have found it much less problematic than our ancient
2005-05-25 21:40:55 +00:00
version of Norton Antivirus Corporate Edition, and much more up-to-date.
2005-03-09 07:59:06 +00:00
</para>
<para >
2005-05-25 21:40:55 +00:00
In short, my users are much happier now that the new server is running, and that
2005-03-10 00:09:15 +00:00
is what is important to me.
2005-03-09 07:59:06 +00:00
</para>
</sect3>
2005-03-08 06:23:08 +00:00
</sect2>
</sect1>
</chapter>