Mac OS X Server 10.2.3 as a SAMBA Primary Domain Controller
Notice: None of the documentation or software provided on this site comes with any kind of warranty whatsoever. Nor, does it come with any kind of endorsement from my employer.
Contents
Introduction
Warning
Step
1: Initial Configuration
Configure
Windows Services
Set
up the share point
Open
Directory Configuration
Step
2: smb.conf
Turn
off Windows Services
Replace
smb.conf
Turn
on Windows Services
Step
3: Accounts
Root
Account
General
User Accounts
Computer
Accounts
Step
4: Creating Directories
Netlogon
Directory
User
Directories
Step
5: Joining the Domain
Introduction
Back
to Contents
This document is
an attempt to provide a thorough step by step guide to setting up a
Primary Domain Controller for Windows 2000 using Mac OS X Server
10.2.3.
If you know what
you are doing, you should be able to deviate from these instructions
at many points to customize your configuration. If you don't know
what your are doing, these instructions should work if you follow
them with tedious accuracy.
A lot of this
information I learned from the following web sites:
http://www.afp548.com/Articles/system/sambapdc.html
http://hr.uoregon.edu/davidrl/samba-pdc.html
Warning
Back
to Contents
These instructions
are not guaranteed to work and may compromise the security or
stability of your server.
Step 1:
Initial Configuration
Back
to Contents
Steps 1 – 4
assume you are working on the Server itself. Many of the steps may be
performed remotely, but are more easily described locally.
OS 10.2 Developer
Tools need to be installed for some of the steps in this document.
The Developer Tools CD should have come with the 10.2 server
software. Install the Developer Tools before proceeding.
Your initial admin
account password, which is also your root password, needs to be at
least five characters in length. If it is shorter than that, I
recommend reinstalling the server software.
If
you can't reinstall the OS, you will need to change the admin
password in “Workgroup Manager” found in
/Applications/Utilities. And, you will need to change the root
password, for both the local and parent domains, in “NetInfo
Manager” found in /Applications/Utilities. Beside being five or
more characters in length, these passwords need to be identical.
-Configure Windows Services
Open “Server
Settings” from /Applications/Utilities.
Authenticate
with your admin account.
Select the
“File & Print” tab.
Click the
“Windows” icon.
Select
“Configure Windows Services”
Set your
server name in the appropriate field.
Set your new
domain name in the “Workgroup” field. Note: [This domain
must not currently have another domain controller.]
Select “Start
Windows Services on system startup”.
Select the
“Neighborhood” tab.
Select
“Enable WINS server.
Select both
“Master Browser” and “Domain Master Browser”.
Select the
“Logging” tab.
Recommended:
Set “Detail Level” to at least “Minimal”.
Save changes.
-Set
up the share point.
Open
“Workgroup Manager” from /Applications/Utilities.
Authenticate
using your admin account.
Select
“Sharing” at the top left.
Select
“Users” under the “Share Points” tab. Note:
[If Users isn't there, select it in the “All” tab in the
root level of your hard drive.]
Make sure
“Share this item and its contents” is selected. Note:
[By default the Owner is set to root and Group to wheel. Both of
these have Read & Write permissions. Everyone is set to Read
Only. These permissions can probably be changed. However, you need
to make sure that the “Staff” group has at least “Read
Only” permissions.]
Select the
“Protocols” tab.
Select
“Windows File Settings” in the drop-down menu.
Select “Share
this item using SMB”.
The “Custom
SMB name:” should be “Users”.
“Default
permissions for new files and folders” should be set as
follows: Owner “Read & Write”, Group “Read
Only”, Everyone “Read Only”. Note: [You will
probably want to set this share point to work with other protocols
such as AFP or NFS depending on other uses for it. For example: I
have mine set to share via NFS and automount to my Macintosh clients
in the Netinfo Domain. This allows my users to access their home
folder whether they log on to a Mac or a PC. Such settings do not
specifically pertain to setting up a PDC and shouldn't affect it.]
Save changes.
-Open Directory Configuration
Open Directory
needs to be set up as follows. You may have done this during the
initial setup of your server. If so, you can skip to Step 2.
To set up Open
Directory:
Launch
/Applications/Utilities/Open Directory Assistant
Authenticate
with an admin account.
Set the
server to use a permanent IP address and subnet.
The server
will – provide directory information to other computers.
You don't
need to enable LDAP.
Password and
authentication information will be – provided to other
systems.
Select SMB-NT
and SMB-Lan Manager protocols. The others may be added as well.
Restart when
completed.
Step 2: smb.conf
Back
to Contents
-Make sure that Windows Services are turned off
Open “Server
Settings” from /Application/Utilities.
Click on the
“File and Print” tab.
Click on the
Windows icon and make sure that it says “Start Windows
Services” at the top. If it says “Stop Windows
Services,” do so.
-Replace /private/etc/smb.conf with the following:
[global]
client
code page = 437
coding
system = utf8
guest
account = unknown
encrypt
passwords = YES
local
master = YES
max
smbd processes = 0
print
command = /usr/sbin/PrintServiceAccess printps %p %s
lpq
command = /usr/sbin/PrintServiceAccess jobs %p
lprm
command = /usr/sbin/PrintServiceAccess remove %p %j
lppause
command = /usr/sbin/PrintServiceAccess hold %p %j
lpresume
command = /usr/sbin/PrintServiceAccess release %p %j
printer
admin = unknown, @staff
server
string = Mac OS X Server
log
file = /Library/Logs/WindowsServices/WindowsFileService.log
netbios
name = servername
workgroup
= domainname
log
level = 2
wins
support = YES
domain
master = YES
admin
users = root
domain
logons = YES
logon
drive = H:
logon
home = \\servername\Users\%u
os
level = 99
preferred
master = yes
security
= user
[homes]
comment
= User Home Directories
read
only = no
create
mode = 0600
directory
mode = 0700
path
= %H
valid
users = @staff
[netlogon]
path
= /etc/samba/netlogon
[Public]
path
= /Shared Items/Public
public
= NO
create
mask = 0644
directory
mask = 0755
read
only = NO
comment
= macosx
[Users]
path
= /Users
public
= NO
create
mask = 0644
directory
mask = 0755
read
only = NO
comment
= macosx
[Groups]
path
= /Groups
public
= NO
create
mask = 0644
directory
mask = 0755
read
only = NO
comment
= macosx
[PrintService]
path
= /Library/Logs/PrintService
public
= NO
create
mask = 0644
directory
mask = 0755
read
only = NO
comment
= macosx
Copy the
above text.
Using
“Project Builder” (Located in /Developer/Applications)
paste it (the above text) in a new “Empty File” named
“smb.conf” in the root ( / ) directory .
Change
“servername”, located after “netbios name”
in the [global] section to your server's name.
Do the same
to “servername” located after “logon home”.
Change
“domainname” located after “workgroup” to
your new domain name.
Save the
file.
Open
“Terminal” located in /Applications/Utilities.
Issue the
following commands:
“sudo
mv /private/etc/smb.conf /private/etc/smb.default.bak”
This will rename the default smb.conf file.
“sudo
mv /smb.conf /private/etc/smb.conf” This will move the
file created above to the necessary location for it to be
implemented by the SAMBA service.
“sudo
chown root /private/etc/smb.conf” Make root the owner
of smb.conf
“sudo
chgrp wheel /private/etc/smb.conf” Assign smb.conf to
the group “wheel.”
“sudo
chflags uchg /private/etc/smb.conf” Set the immutable
flag on the smb.conf file so that “Server Settings”
can't reset it. Note: [If you ever need to make changes to smb.conf
you will have to type: “sudo chflags
nouchg /private/etc/smb.conf” to unset the immutable
flag.]
-Turn Windows Services back on
Open “Server
Settings” from /Application/Utilities
Click on the
“File and Print” tab.
Click on the
Windows icon and select “Start Windows Services” at the
top.
Step 3: Accounts
Back
to Contents
-The root
account
By default the
root account has the same password as the primary admin account. The
following instructions assume and require this to be true.
By default the
root account password is not included in password server. It is best
to keep it that way for security purposes. However, to add a client
to SAMBA PDC, you need to use the root account, and to authenticate
from a Windows computer, you need to have a Password Server password.
The following is a
work-around. What it does is to allow the root user to authenticate
from a PC using the admin user's password. This is a security risk.
Launch
“/Applications/Utilities/Workgroup Manager”
Authenticate
as the admin user.
Select the
admin user.
Click the
“Advanced” tab.
Make sure
that under “User Password Type”, “Password Server”
is selected. If it is not, run through “Open Directory
Assistant” again.
Launch
“/Applications/Utilities/NetInfo Manager.”
Authenticate
as “root”. Note: [Click the lock at the bottom left of
the window to authenticate.]
Select users.
Select your
admin account under users.
Copy the
value of the
“authentication_authority”
property.
Select root
under users.
Select “New
Property” from the “Directory” menu.
Replace
“new_property” with “authentication_authority”.
Paste the
value copied in step 11 over “new_value”.
Select “Save
Changes” under the “Domain” menu.
Click “Open
Parent” in the tool bar.
Repeat
actions 7 – 15 above. Note: [The first time through sets the
root account for the local domain. The second time sets the root
account for the parent domain.]
Open
“/Applications/Utilities/Terminal”
Type: “sudo
smbpasswd -a root” to create your root SMB password.
Note: [You will probably have to authenticate as root before it will
let you set the password, then it will ask for the new password
twice. Make sure to use the same password that you currently have
for your root and admin accounts. If you get an error: “unable
to open passdb database.”, redo this step. It shouldn't give
an error the second time.]
-General
User Accounts
Create regular
users in the standard way with “/Applications/Utilities/Workgroup
Manager” (Make sure to set the “User Password Type”
as “Password Server” in the “Advanced” tab).
For help with this see the “Admin_Guide” available at the
following web site:
http://docs.info.apple.com/article.html?artnum=122015
Note: [The user's
home directory should be in the default directory (/Users), and the
users need to be in the default group, 20 (staff).]
After the account
is in Workgroup Manager you need to set it in the samba database as
follows:
Open
“/Applications/Utilities/Terminal”
Type “sudo
smbpasswd -a username”
where username is the user's short name. Note: [It may require you
to authenticate with the root password before allowing you to enter
the user's password.]
Set the
password the same as you did in “Workgroup Manager”.
-Computer
Accounts
Create the
computer accounts with “/Applications/Utilities/Workgroup
Manager” in the same way as user accounts with the following
exceptions:
If you want
to have the computer accounts organized separately from the user
accounts, start them with something like “pc”.
Add an s to
the end of the short name. Note: [The short name and the computer's
name must be identical with the exception of the s at the end of the
short name]
Make the
characters in the short name all lower case.
Set the
“Login Shell” to “None” in the “Advanced”
tab.
Under the
“Home” tab select “No Home”.
Samba requires a
computer account to have a $ at the end. However, “Workgroup
Manager” won't accept special characters. To correct this
perform the following steps:
Launch
“/Applications/Utilities/NetInfo Manager.”
Click “Open
Parent” in the tool bar.
Authenticate
as “root”.
Select users.
Select the
machine account that you created above.
Edit the
fields that have an s at the end of the short name (there are
probably 3 of them). Change the s to a $.
Select “Save
Changes” under the “Domain” menu.
Now you need to
add the account to the samba database as follows:
Open
“/Applications/Utilities/Terminal”
Type “sudo
smbpasswd -a -m computername” where computername is the
short name without the $.
Type “sudo
smbpasswd computername$”
Set the
password the same as in “Workgroup Manager”.
Step 4:
Creating Directories
Back
to Contents
-Netlogon
Directory
We need to create
a netlogon directory for authentication scripts and the like.
Open
“/Applications/Utilities/Terminal”
Type: “sudo
mkdir /etc/samba”
Type: “sudo
mkdir /etc/samba/netlogon”
Type: “sudo
chown -R root /etc/samba”
Type: “sudo
chgrp -R staff /etc/samba”
Note: [I haven't
tested using scripts in this directory, but see no reason why they
wouldn't work.]
-User
Home Directories
Home directories
are supposed to be created automatically when users log in to a
Macintosh on the NetInfo domain. Since these users aren't necessarily
going to be logging into a Mac at all, we need to create the home
directory manually.
Open
“/Applications/Utilities/Terminal”
Type: “sudo
mkdir /Users/username” where username is the short name of a user created earlier.
Type: “sudo
mkdir /Users/username/profile”
Type: “sudo chown
-R username /Users/username”
Type: “sudo chgrp
-R staff /Users/username”
Type: “sudo chmod
755 /Users/username”
Type: “sudo chmod
-R 700 /Users/username/profile”
Reboot the server
now – just for good measure.
Step 5: Joining
the Domain
Back
to Contents
These instructions
are for Windows 2000. Perform these steps from the Windows 2000
client. Note: [The web sites mentioned at the beginning of this
document can help you with other Oss.]
Right click
on “My Computer” and select “Properties”.
Click the
“Network Identification” tab.
Click
“Properties”
Note: If the
“Computer name” is different from the computername
(without $) in Step 2, you will need to change that and restart.
Select
“Domain”
Enter the
“Workgroup” name that you selected in Step 1 and your
smb.conf file.
When prompted
for a user name with permission to join the domain you need to use
the root account.
Congratulations, your PDC should be up and running.
If it isn't, you can email me at support@twomblys.com.
|