LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-04-2005, 01:05 AM   #1
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
OpenLDAP & samba PDC


hi there,

i'm still trying to get my OpenLDAP + phpldapadmin + samba PDC working, i think i'm getting closer there are much less error messages in my /var/log/samba/smbd.log file now.

when i try and add my windows XP box to my domain it asks for a username and password, now no matter what username and password i give it, it still dosn't work. i've added my root user via phpLDAPadmin and 'smbpasswd -a root'

[root@redhat /]# smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.
[root@redhat /]#

here is what i have done, can somone tell me what i'm missing?

service smb stop
service ldap stop

vi /etc/openldap/slapd.conf


database ldbm
suffix "dc=fedora,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au"
rootdn "cn=Directory Manager,dc=redhat,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au"
rootpw {SSHA}I3wVTWA2e0DzH93Op6ydBBBdRSkZtZts

vi etc/openldap/ldap.conf

HOST fedora.school.cathedral.qld.edu.au
BASE dc=fedora,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au


vi /var/www/html/php/config.php


$blowfish_secret = 'secert';

$servers[$i]['name'] = 'My LDAP Server';
$servers[$i]['host'] = 'fedora.school.cathedral.qld.edu.au'
$servers[$i]['base'] = 'dc=fedora,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au';
$servers[$i]['port'] = 389;
$servers[$i]['auth_type'] = 'cookie';
$servers[$i]['login_dn'] = 'cn=Directory Manager,dc=fedora,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au';
$servers[$i]['login_pass'] = 'secert';

service ldap start

ldapadd -x -D 'cn=Directory Manager,dc=fedora,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au' -W -f /tmp/users.ldif

vi /var/www/html/php/templates/template_config.php

// Default domains definition (Customize)
// (use `net getlocalsid` on samba server)
$samba3_domains = array();
$samba3_domains[] =
array(
'name' => 'fedora', // 'My Samba domain Name',
'sid' => 'S-1-5-21-3310931982-2564130707-2785395506'
);


vi /etc/samba/smb.conf


#LDAP

passdb backend = ldapsam:ldap://redhat.school.cathedral.qld.edu.au
ldap admin dn = "cn=directory manager,dc=redhat,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au"
ldap suffix = "cn=users,dc=redhat,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au"
ldap filter ="(&(uid=%U)(objectclass=sambaAccount))"

#LDAP & samba

delete user script = /usr/local/bin/smbldap-userdel.pl "%u"
add machine script = /usr/local/bin/smbldap-useradd.pl -w "%u"
add group script = /usr/local/bin/smbldap-groupadd.pl -p "%g"
delete group script = /usr/local/bin/smbldap-groupdel.pl "%g"
add user to group script = /usr/local/bin/smbldap-groupmod.pl -m "%u" "%g"
delete user from group script = /usr/local/bin/smbldap-groupmod.pl -x "%u" "%g"
set primary group script = /usr/local/bin/smbldap-usermod.pl -g "%g" "%u"


workgroup = fedora
netbios name = fedora
comment = Linux RedHat Samba Server
security = user
null passwords = Yes
encrypt passwords = yes

logon drive = U:
logon path = \\%N\profiles\%g

domain master = yes
domain logons = yes
preferred master = yes
os level = 255

# we have other wins server (samba, of course)
#wins support = yes
wins support = no
wins proxy = no
wins server = 159.237.12.25

log file = /etc/samba/logs/smb.log
public = No
browseable = No
writable = No

[netlogon]
path = /etc/samba/netlogon
locking = no
read only = yes
write list = ntadmin

; share for storing user profiles
[profiles]
path = /etc/samba/profiles
read only = no
writeable = yes
create mask = 0600
directory mask = 0700

then i have added my 'machine account' via phpldapadmin and the root user via phpldapadmin and restarted everything and it still will not work?
 
Old 08-04-2005, 01:40 AM   #2
climbingmerlin
Member
 
Registered: Mar 2004
Location: UK
Distribution: Fedora, OpenSuse
Posts: 91

Rep: Reputation: 15
Hi,

Have you had a look at IDEALX.org's tools for a samba PDC? They provide scripts and HOW-TO's with examples. This is what we are using and it works like a dream, can add users and machines with no major problems.

Plus they also provide a console (web interface) so that it is 'easier' to add users instead of using the terminal. So that your admins that are not too familiar with Linux can do all the account administration.

Have a look, it won't take too long to set up. http://www.idealx.org/prj/samba/index.en.html

Any problems let me know.
 
Old 08-04-2005, 09:52 AM   #3
shane200_
Member
 
Registered: Dec 2004
Location: Jamaica
Posts: 80

Rep: Reputation: 15
Please post your /etc/nsswitch.conf and /etc/ldap.conf files. Are you using SSL to encrypt the LDAP data?
 
Old 08-04-2005, 05:12 PM   #4
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Original Poster
Rep: Reputation: 30
/etc/nsswitch.conf

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# nisplus or nis+ Use NIS+ (NIS version 3)
# nis or yp Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the local database (.db) files
# compat Use NIS on compat mode
# hesiod Use Hesiod for user lookups
# [NOTFOUND=return] Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis

passwd: files ldap
shadow: files ldap
group: files ldap

#hosts: db files nisplus nis dns
hosts: files dns

# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files

netgroup: files

publickey: nisplus

automount: files
aliases: files nisplus

/etc/openldap/ldap.conf

HOST redhat.school.cathedral.qld.edu.au
BASE dc=redhat,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au

/etc/ldap.conf

# @(#)$Id: ldap.conf,v 1.27 2003/01/17 21:37:12 lukeh Exp $
#
# This is the configuration file for the LDAP nameservice
# switch library and the LDAP PAM module.
#
# PADL Software
# http://www.padl.com
#

# Your LDAP server. Must be resolvable without using LDAP.
# Multiple hosts may be specified, each separated by a
# space. How long nss_ldap takes to failover depends on
# whether your LDAP client library supports configurable
# network or connect timeouts (see bind_timelimit).
host 127.0.0.1

# The distinguished name of the search base.
base cn=users,dc=redhat,dc=school,dc=cathedral,dc=qld,dc=edu,dc=au

# Another way to specify your LDAP server is to provide an
# uri with the server name. This allows to use
# Unix Domain Sockets to connect to a local LDAP Server.
#uri ldap://127.0.0.1/
#uri ldaps://127.0.0.1/
#uri ldapi://%2fvar%2frun%2fldapi_sock/
# Note: %2f encodes the '/' used as directory separator

# The LDAP version to use (defaults to 3
# if supported by client library)
#ldap_version 3

# The distinguished name to bind to the server with.
# Optional: default is to bind anonymously.
#binddn cn=proxyuser,dc=example,dc=com

# The credentials to bind with.
# Optional: default is no credential.
#bindpw secret

# 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=example,dc=com

# The port.
# Optional: default is 389.
#port 389

# The search scope.
#scope sub
#scope one
#scope base

# Search timelimit
#timelimit 30

# Bind timelimit
#bind_timelimit 30

# Idle timelimit; client will close connections
# (nss_ldap only) if the server has not been contacted
# for the number of seconds specified below.
#idle_timelimit 3600

# Filter to AND with uid=%s
#pam_filter objectclass=account

# The user ID attribute (defaults to uid)
#pam_login_attribute uid

# Search the root DSE for the password policy (works
# with Netscape Directory Server)
#pam_lookup_policy yes

# Check the 'host' attribute for access control
# Default is no; if set to yes, and user has no
# value for the host attribute, and pam_ldap is
# configured for account management (authorization)
# then the user will not be allowed to login.
#pam_check_host_attr yes

# Group to enforce membership of
#pam_groupdn cn=PAM,ou=Groups,dc=example,dc=com

# Group member attribute
#pam_member_attribute uniquemember

# Specify a minium or maximum UID number allowed
#pam_min_uid 0
#pam_max_uid 0

# Template login attribute, default template user
# (can be overriden by value of former attribute
# in user's entry)
#pam_login_attribute userPrincipalName
#pam_template_login_attribute uid
#pam_template_login nobody

# HEADS UP: the pam_crypt, pam_nds_passwd,
# and pam_ad_passwd options are no
# longer supported.

# Do not hash the password at all; presume
# the directory server will do it, if
# necessary. This is the default.
#pam_password clear

# Hash password locally; required for University of
# Michigan LDAP server, and works with Netscape
# Directory Server if you're using the UNIX-Crypt
# hash mechanism and not using the NT Synchronization
# service.
#pam_password crypt

# Remove old password first, then update in
# cleartext. Necessary for use with Novell
# Directory Services (NDS)
#pam_password nds

# Update Active Directory password, by
# creating Unicode password and updating
# unicodePwd attribute.
#pam_password ad

# Use the OpenLDAP password change
# extended operation to update the password.
#pam_password exop

# Redirect users to a URL or somesuch on password
# changes.
#pam_password_prohibit_message Please visit http://internal to change your password.

# RFC2307bis naming contexts
# Syntax:
# nss_base_XXX base?scope?filter
# where scope is {base,one,sub}
# and filter is a filter to be &'d with the
# default filter.
# You can omit the suffix eg:
# nss_base_passwd ou=People,
# to append the default base DN but this
# may incur a small performance impact.
#nss_base_passwd ou=People,dc=example,dc=com?one
#nss_base_shadow ou=People,dc=example,dc=com?one
#nss_base_group ou=Group,dc=example,dc=com?one
#nss_base_hosts ou=Hosts,dc=example,dc=com?one
#nss_base_services ou=Services,dc=example,dc=com?one
#nss_base_networks ou=Networks,dc=example,dc=com?one
#nss_base_protocols ou=Protocols,dc=example,dc=com?one
#nss_base_rpc ou=Rpc,dc=example,dc=com?one
#nss_base_ethers ou=Ethers,dc=example,dc=com?one
#nss_base_netmasks ou=Networks,dc=example,dc=com?ne
#nss_base_bootparams ou=Ethers,dc=example,dc=com?one
#nss_base_aliases ou=Aliases,dc=example,dc=com?one
#nss_base_netgroup ou=Netgroup,dc=example,dc=com?one

# attribute/objectclass mapping
# Syntax:
#nss_map_attribute rfc2307attribute mapped_attribute
#nss_map_objectclass rfc2307objectclass mapped_objectclass

# configure --enable-nds is no longer supported.
# For NDS now do:
#nss_map_attribute uniqueMember member

# configure --enable-mssfu-schema is no longer supported.
# For MSSFU now do:
#nss_map_objectclass posixAccount User
#nss_map_attribute uid msSFUName
#nss_map_attribute uniqueMember posixMember
#nss_map_attribute userPassword msSFUPassword
#nss_map_attribute homeDirectory msSFUHomeDirectory
#nss_map_objectclass posixGroup Group
#pam_login_attribute msSFUName
#pam_filter objectclass=User
#pam_password ad

# configure --enable-authpassword is no longer supported
# For authPassword support, now do:
#nss_map_attribute userPassword authPassword
#pam_password nds

# For IBM SecureWay support, do:
#nss_map_objectclass posixAccount aixAccount
#nss_map_attribute uid userName
#nss_map_attribute gidNumber gid
#nss_map_attribute uidNumber uid
#nss_map_attribute userPassword passwordChar
#nss_map_objectclass posixGroup aixAccessGroup
#nss_map_attribute cn groupName
#nss_map_attribute uniqueMember member
#pam_login_attribute userName
#pam_filter objectclass=aixAccount
#pam_password clear

# Netscape SDK LDAPS
#ssl on

# Netscape SDK SSL options
#sslpath /etc/ssl/certs/cert7.db

# OpenLDAP SSL mechanism
# start_tls mechanism uses the normal LDAP port, LDAPS typically 636
#ssl start_tls
#ssl on

# OpenLDAP SSL options
# Require and verify server certificate (yes/no)
# Default is "no"
#tls_checkpeer yes

# CA certificates for server certificate verification
# At least one of these are required if tls_checkpeer is "yes"
#tls_cacertfile /etc/ssl/ca.cert
#tls_cacertdir /etc/ssl/certs

# Seed the PRNG if /dev/urandom is not provided
#tls_randfile /var/run/egd-pool

# SSL cipher suite
# See man ciphers for syntax
#tls_ciphers TLSv1

# Client certificate and key
# Use these, if your server requires client authentication.
#tls_cert
#tls_key
ssl no
pam_password md5



and thanks i'll look into IDEALX.org's tools, but if there was a way i would stick with phpldapadmin i'd be happier.
 
Old 08-05-2005, 10:28 PM   #5
zen0n
LQ Newbie
 
Registered: Jul 2004
Location: Winnipeg
Distribution: debian
Posts: 22

Rep: Reputation: 15
Your best bet would be to follow John Terpstra's walk thru on the samba.org site samba 3 by example and follow it to the letter with his domain settings and info.

Once you have that working, you can migrate off of his settings onto yours.

That's how I got mine working and you do get a full understanding of the ldap behind it all aswell.

Also, the smbldap-tools package is very handy for creating users and quickly checking attributes fromt he command-line. I fully recommend it..

Ryan
 
Old 08-26-2005, 12:01 AM   #6
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Original Poster
Rep: Reputation: 30
i eventually figured out all i could with my OpenLDAP + LAM + Samba as a primary domain controller and i posted it on my blog at my website if anyone is interested

Openldap, lam & samba as pdc
http://www.opensourcehowto.org/how-t...ba-as-pdc.html

Last edited by paul_mat; 04-14-2007 at 10:53 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba PDC & Win2K Profiles Pimple Linux - Networking 2 01-14-2006 10:43 AM
Samba-3 PDC trusting M$ Windows 2000 & AD climbingmerlin Linux - Networking 1 08-14-2005 07:11 AM
SAMBA PDC & XP can't join calabash Linux - Networking 5 02-16-2004 03:39 PM
samba PDC & LMB sync problem netguy2000 Linux - Networking 0 01-16-2004 07:02 AM
Samba Pdc & Account Logon Issues TheTrexx Linux - Networking 2 01-06-2003 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration