爱生活,爱IT
全部博文(436)
分类:
2007-04-22 20:16:48
|
|
|
|
|
|
|
|
|
|
mkdir -p CA/certs CA/crl CA/newcerts CA/private
chmod 700 CA/private
touch CA/index.txt
echo 01 > CA/serial |
# The dir parameter is important because it tells
# openssl where to find all necessary files used to
# generate keys.
dir = ./
# default_days defines the length of time your key is valid for.
default_days = 3650
# default_bits is an indicator of the strength of your key. I elected
# 1024 but you can choose more or less.
default_bits = 1024
# The following parameters should be modified to fit your
# organization.
countryName_default = US
stateOrProvinceName_default = North Carolina
localityName_default = Raleigh
0.organizationName_default = somedomain.com |
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/samba.schema
# -1 is all messages 296 is a good compromise for most debugging
#loglevel -1
pidfile /var/run/slapd.pid
argsfile /var/run/slapd.args
# The following three lines are related to security. Leave them commented out now.
# We uncomment them and enable security *after* we have successfully tested Samba with
# LDAP in an unsecured configuration. Debugging is infinitely easier without encryption
# enabled.
#TLSCipherSuite HIGH
#TLSCertificateFile /etc/openldap/slapd-cert.pem
#TLSCertificateKeyFile /etc/openldap/slapd-key.pem
database bdb
# MODIFY
# Modify suffix and rootdn to match your domain name.
suffix "dc=somedomain,dc=com"
rootdn "cn=Manager,dc=somedomain,dc=com"
# MODIFY
# Use the following to generate:
# slappasswd -h {SSHA} -s
rootpw {SSHA}kCuJt72QLJ2O06nFUvdre97sHT0AxlH/
# MODIFY
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended with an owner of ldap and a group of ldap
directory /var/lib/ldap/somedomain.com
# Indices to maintain for this database
index objectClass eq
index cn pres,sub,eq
index sn pres,sub,eq
index uid pres,sub,eq
index displayName pres,sub,eq
index uidNumber eq
index gidNumber eq
index memberUID eq
index sambaSID eq
index sambaPrimaryGroupSID eq
index sambaDomainName eq
index default sub
# Access Control Entries
# Note these ACEs are duplicated from the IDEALX smbldap usermanual with one exception
# users can authenticate and change their password access to attrs=userPassword,
sambaNTPassword,sambaLMPassword,sambaPwdLastSet,sambaPwdMustChange
by dn="uid=samba,ou=Users,dc=somedomain,dc=com" write
by self write
by anonymous auth
by * none
# some attributes need to be readable anonymously so that 'id user' can answer correctly
access to attrs=objectClass,entry,gecos,homeDirectory,uid,uidNumber,gidNumber,cn,
memberUid
by dn="uid=samba,ou=Users,dc=somedomain,dc=com" write
by * read
# somme attributes can be writable by users themselves
access to attrs=description,telephoneNumber
by dn="uid=samba,ou=Users,dc=somedomain,dc=com" write
by self write
by * read
# some attributes need to be writable for samba (this ACE modified from original to allow
some unix commands to work) access to attrs=cn,sambaLMPassword,sambaNTPassword,
sambaPwdLastSet,sambaLogonTime,sambaLogoffTime,sambaKickoffTime,sambaPwdCanChange,
sambaPwdMustChange,sambaAcctFlags,displayName,sambaHomePath,sambaHomeDrive,
sambaLogonScript,sambaProfilePath,description,sambaUserWorkstations,sambaPrimaryGroupSID,
sambaDomainName,sambaSID,sambaGroupType,sambaNextRid,sambaNextGroupRid,sambaNextUserRid,
sambaAlgorithmicRidBase,sambaLogonScript,loginShell
by dn="uid=samba,ou=Users,dc=somedomain,dc=com" write
by self read
by * none
# samba need to be able to create the samba domain account
access to dn.base="dc=somedomain,dc=com"
by dn="uid=samba,ou=Users,dc=somedomain,dc=com" write
by * none
# samba need to be able to create new users account
access to dn="ou=Users,dc=somedomain,dc=com"
by dn="uid=samba,ou=Users,dc=somedomain,dc=com" write
by * none
# samba need to be able to create new groups account
access to dn="ou=Groups,dc=somedomain,dc=com"
by dn="uid=samba,ou=Users,dc=somedomain,dc=com" write
by * none
# samba need to be able to create new computers account
access to dn="ou=Computers,dc=somedomain,dc=com"
by dn="uid=samba,ou=Users,dc=somedomain,dc=com" write
by * none
# this can be omitted but we leave it: there could be other branch
# in the directory
access to *
by self read
by * none |
## IMPORTANT
## The /etc/ldap.conf file is used by PAM. There is another ldap.conf file in
## /etc/openldap.
## The file, /etc/openldap/ldap.conf, is used by ldap tools, such as ldapsearch.
## If you intend to use those tools you will need to add a TLS_CACERT directive to that
## file also.
# Your LDAP server. Must be resolvable without using LDAP.
# Multiple hosts may be specified, each separated by a
# space.
host 127.0.0.1
# MODIFY
# The distinguished name of the search base.
base dc=somedomain,dc=com
# MODIFY
# The distinguished name to bind to the server with.
# We will use the root dn until we can create a lesser privileged user.
binddn cn=Manager,dc=somedomain,dc=com
bindpw < use the password you created for Manager in "Step 4: Configure slapd.conf">
# MODIFY
# Note: "ou=Users" and "ou=Groups" should match what
# you entered in smb.conf for "ldap group suffix"
# and "ldap user suffix"
nss_base_passwd ou=Users,dc=somedomain,dc=com?one
nss_base_passwd ou=Computers,dc=somedomain,dc=com?one
nss_base_shadow ou=Users,dc=somedomain,dc=com?one
nss_base_group ou=Groups,dc=somedomain,dc=com?one
ssl no
pam_password md5
# We need to tell PAM where the certificate used to authenticate the LDAP
# server (i.e. is the LDAP server the one we think it is).
tls_cacertfile /etc/openldap/cacert.pem
# If you experience difficulty authenticating after enabling TLS, try uncommenting
# the next line. You will know that you are having problems if you
# issue "getent group" and do not see any of the MS Windows groups
# that have been created in your LDAP database.
# tls_checkpeer no |