June 14, 2007, 4:29 a.m.
posted by whitehat
Creating a Starter ConfigurationThe easiest way to configure a Samba server to be the PDC for a small network is by using SWAT. You'll need to edit the various sections of the smb.conf file, so I'll walk you through what you'll find in each. The [global] SectionThe [global] section governs the general Samba settings. Figure explains the parameters you need to set to create a PDC. Here's how to set the values using SWAT:
[global]
workgroup = HOMENET
time server = Yes
domain logons = Yes
os level = 65
preferred master = Yes
domain masterc = Yes
Be aware: Security [eq] user and WINS support [eq] yes are default settings for Samba, and they may not show up in your smb.conf file, even though you may see them in SWAT. Using the SWAT WizardThe SWAT utility has a Wizard button that can be used to configure your server as a PDC quickly. However the defaults may not be to your liking. For example, the default domain is MYGROUP, and some of the [global] parameters mentioned previously will be set to Auto. The [homes] SectionPart of the process of adding a user to a Samba domain requires you to create a Linux user on the Samba PDC itself. When you log into the Samba PDC, you'll see a new drive, usually named Z:, added to your PC. This is actually a virtual drive that maps to the corresponding Linux users' login directories on the Linux PDC. Samba considers all directories to be shares that can be configured with varying degrees of security. The [homes] section governs how Samba handles default login directories. Figure explains the minimum settings you need to create a functional [homes] section.
Here's how to set the values using SWAT:
Your smb.conf file should resemble this when finished. You can view the contents of the configuration file by logging into the Samba server via a command prompt and using cat /etc/samba/smb.conf to verify your changes as you do them.
[homes]
read only = No
browseable = No
create mask = 0644
directory mask = 0755
The [netlogon] and [profiles] Share SectionsThe [netlogon] share section contains scripts that the Windows clients may use when they log into the domain. The [profiles] share section stores settings related to the look and feel of Windows so that the user has the same settings no matter which Windows PC is logged into. The [profiles] share section stores such things as favorites and desktop icons. Your smb.conf file should look like this when you're finished:
[netlogon]
path = /home/samba/netlogon
guest ok = Yes
[profiles]
path = /home/samba/profiles
read only = No
create mask = 0600
directory mask = 0700
Here's how to do it:
Remember to create these share directories from the command line afterwards:
[root@bigboy tmp]# mkdir -p /home/samba/netlogon
[root@bigboy tmp]# mkdir -p /home/samba/profile
[root@bigboy tmp]# chmod -r 0755 /home/samba
The [printers] Share SectionSamba has special shares just for printers, and these are configured in the [printers] section of SWAT. There is also a share under [printers] called printers that governs common printer settings. Print shares always have the printable parameter set to yes. The default smb.conf [printers] share section looks like this:
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
Shares for Specific Groups of UsersThe default Samba Version 3 smb.conf file you saved at the beginning of this exercise has many varied examples that you may use and apply to your particular environment. You can find the steps for creating a simple shared directory for home users in Chapter 11, "Sharing Resources Using Samba." |
- Comment