LinuxForum.Fans
Тема

пару вопросов по PDC samba-ldap centos 5.5

Автор: yok 5 сообщений 2498 просмотров
#278423

Впервые настраиваю контролер домена на centos 5.5
Пользователи и компы добавляются, виндовс компы ввожу в домен.
Но не могу разобраться с профилем, хочу чтобы были перемещаемые профили.
Но не получается.
То ругается что не может найти профиль, после корректировки вообще тихо заходит а профиля на сервере нет.
Подскажите что сделать надо.
Вот конфигурация.

это smb.conf

Показать
# Global parameters
[global]
workgroup = sunport
netbios name = pdc
security = user
enable privileges = yes
#interfaces = 192.168.5.11
#username map = /etc/samba/smbusers
server string = Samba Server %v
#security = ads
encrypt passwords = Yes
# min passwd length = 3
#pam password change = no
#obey pam restrictions = No

# method 1:
#unix password sync = no
#ldap passwd sync = yes

ldap ssl = off

# method 2:
unix password sync = yes
ldap passwd sync = yes
passwd program = /usr/sbin/smbldap-passwd -u "%u"
passwd chat = "Changing *\nNew password*" %n\n "*Retype new password*" %n\n"

log level = 0
syslog = 0
log file = /var/log/samba/log.%U
max log size = 100000
time server = Yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
mangling method = hash2
Dos charset = 850
Unix charset = ISO8859-1

logon script = logon.bat
logon drive = H:
logon home =
logon path =

domain logons = Yes
domain master = Yes
os level = 65
preferred master = Yes
wins support = yes
# passdb backend = ldapsam:"ldap://ldap1.company.com ldap://ldap2.company.com"
passdb backend = ldapsam:ldap://127.0.0.1/
ldap admin dn = cn=tirex,dc=sunport,dc=ms
#ldap admin dn = cn=samba,ou=DSA,dc=company,dc=com
ldap suffix = dc=sunport,dc=ms
ldap group suffix = ou=Group
ldap user suffix = ou=User
ldap machine suffix = ou=Computers
#ldap idmap suffix = ou=Idmap
add user script = /usr/sbin/smbldap-useradd -m "%u"
#ldap delete dn = Yes
delete user script = /usr/sbin/smbldap-userdel "%u"
add machine script = /usr/sbin/smbldap-useradd -t 0 -w "%u"
add group script = /usr/sbin/smbldap-groupadd -p "%g"
#delete group script = /usr/sbin/smbldap-groupdel "%g"
add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
set primary group script = /usr/sbin/smbldap-usermod -g '%g' '%u'

# printers configuration
#printer admin = @"Print Operators"
load printers = Yes
create mask = 0640
directory mask = 0750
#force create mode = 0640
#force directory mode = 0750
nt acl support = yes
printing = cups
printcap name = cups
deadtime = 10
guest account = nobody
map to guest = Bad User
dont descend = /proc,/dev,/etc,/lib,/lost+found,/initrd
show add printer wizard = yes
; to maintain capital letters in shortcuts in any of the profile folders:
preserve case = yes
short preserve case = yes
case sensitive = no

[netlogon]
path = /home/samba/netlogon/
browseable = No
read only = yes

[profiles]
path = /home/samba/profiles
read only = no
create mask = 0600
directory mask = 0700
browseable = No
guest ok = Yes
profile acls = yes
csc policy = disable
# next line is a great way to secure the profiles
#force user = %U
# next line allows administrator to access all profiles
#valid users = %U "Domain Admins"

[printers]
comment = Network Printers
#printer admin = @"Print Operators"
guest ok = yes
printable = yes
path = /home/samba/spool/
browseable = No
read only = Yes
printable = Yes
#print command = /usr/bin/lpr -P%p -r %s
#lpq command = /usr/bin/lpq -P%p
#lprm command = /usr/bin/lprm -P%p %j
# print command = /usr/bin/lpr -U%U@%M -P%p -r %s
# lpq command = /usr/bin/lpq -U%U@%M -P%p
# lprm command = /usr/bin/lprm -U%U@%M -P%p %j
# lppause command = /usr/sbin/lpc -U%U@%M hold %p %j
# lpresume command = /usr/sbin/lpc -U%U@%M release %p %j
# queuepause command = /usr/sbin/lpc -U%U@%M stop %p
# queueresume command = /usr/sbin/lpc -U%U@%M start %p

[print$]
path = /home/samba/printers
guest ok = No
browseable = Yes
read only = Yes
valid users = @"Print Operators"
write list = @"Print Operators"
create mask = 0664
directory mask = 0775

[public]
path = /tmp
guest ok = yes
browseable = Yes
writable = yes

а это smbldap.conf

Показать

# smbldap-tools.conf : Q & D configuration file for smbldap-tools

# This code was developed by IDEALX (http://IDEALX.org/) and
# contributors (their names can be found in the CONTRIBUTORS file).
#
# Copyright (C) 2001-2002 IDEALX
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.

# Purpose :
# . be the configuration file for all smbldap-tools scripts

##############################################################################
#
# General Configuration
#
##############################################################################

# Put your own SID. To obtain this number do: "net getlocalsid".
# If not defined, parameter is taking from "net getlocalsid" return

SID="S-1-5-21-1871841520-3204539377-781500168"

# Domain name the Samba server is in charged.
# If not defined, parameter is taking from smb.conf configuration file
# Ex: sambaDomain="IDEALX-NT"

sambaDomain="sunport"

##############################################################################
#
# LDAP Configuration
#
##############################################################################

# 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)

# Slave LDAP server
# Ex: slaveLDAP=127.0.0.1
# If not defined, parameter is set to "127.0.0.1"
slaveLDAP="127.0.0.1"

# Slave LDAP port
# If not defined, parameter is set to "389"
slavePort="389"

# Master LDAP server: needed for write operations
# Ex: masterLDAP=127.0.0.1
# If not defined, parameter is set to "127.0.0.1"
masterLDAP="127.0.0.1"

# Master LDAP port
# If not defined, parameter is set to "389"
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)
# If not defined, parameter is set to "1"
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=""

# 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

suffix="dc=sunport,dc=ms"

# Where are stored Users
# Ex: usersdn="ou=Users,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for usersdn

usersdn="ou=People,${suffix}"

# Where are stored Computers
# Ex: computersdn="ou=Computers,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for computersdn

computersdn="ou=Computers,${suffix}"

# Where are stored Groups
# Ex: groupsdn="ou=Groups,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for groupsdn

groupsdn="ou=Group,${suffix}"

# Where are stored Idmap entries (used if samba is a domain member server)
# Ex: groupsdn="ou=Idmap,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for idmapdn

idmapdn="ou=Idmap,${suffix}"

# Where to store next uidNumber and gidNumber available for new users and groups
# If not defined, entries are stored in sambaDomainName object.
# Ex: sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
# Ex: sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
sambaUnixIdPooldn="sambaDomainName=sunport,${suffix}"

# Default scope Used

scope="sub"

# Unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA, CLEARTEXT)

hash_encrypt="SSHA"

# 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=""

##############################################################################
#
# Unix Accounts Configuration
#
##############################################################################

# Login defs
# Default Login Shell
# Ex: userLoginShell="/bin/bash"

userLoginShell="/bin/bash"

# Home directory
# Ex: userHome="/home/%U"

userHome="/home/%U"

# Default mode used for user homeDirectory

userHomeDirectoryMode="700"

# Gecos

userGecos="System User"

# Default User (POSIX and Samba) GID

defaultUserGid="513"

# Default Computer (Samba) GID

defaultComputerGid="515"

# Skel dir

skeletonDir="/etc/skel"

# 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)
defaultMaxPasswordAge="45"

##############################################################################
#
# SAMBA Configuration
#
##############################################################################

# The UNC path to home drives location (%U username substitution)
# Just set it to a null string if you want to use the smb.conf 'logon home'
# directive and/or disable roaming profiles
# Ex: userSmbHome="\\PDC-SMB3\%U"

#userSmbHome="\\%L\%U"
userSmbHome="\\pdc\home\%U"

# The UNC path to profiles locations (%U username substitution)
# Just set it to a null string if you want to use the smb.conf 'logon path'
# directive and/or disable roaming profiles
# Ex: userProfile="\\PDC-SMB3\profiles\%U"

#userProfile="\\%L\profiles\%U"
userProfile="\\pdc\home\samba\profiles\%U"

# The default Home Drive Letter mapping
# (will be automatically mapped at logon time if home directory exist)
# Ex: userHomeDrive="H:"

#userHomeDrive="Z:"
userHomeDrive="H:"

# The default user netlogon script name (%U username substitution)
# if not used, will be automatically username.cmd
# make sure script file is edited under dos
# Ex: userScript="startup.cmd" # make sure script file is edited under dos
userScript="logon.bat"

# Domain appended to the users "mail"-attribute
# when smbldap-useradd -M is used
# Ex: mailDomain="idealx.com"
mailDomain="sunport.ms"

##############################################################################
#
# SMBLDAP-TOOLS Configuration (default are ok for a RedHat)
#
##############################################################################

# Allows not to use smbpasswd (if with_smbpasswd="0" in smbldap.conf) but
# prefer Crypt::SmbHash library
with_smbpasswd="0"
smbpasswd="/usr/bin/smbpasswd"

# Allows not to use slappasswd (if with_slappasswd="0" in smbldap.conf)
# but prefer Crypt:: libraries
with_slappasswd="0"
slappasswd="/usr/sbin/slappasswd"

# comment out the following line to get rid of the default banner
# no_banner="1"

права на папку /home/samba/profiles дал 512:512 1777

Предполагаю что при первом подключении пользователя создается его профайл и туда кидаются какие то файлы, нигде не могу найти почитать про это.
Подскажите что делать?

И еще когда создавал базу лдапа с помощью команды smbldap-populate были созданы первые пользователи, и у них были параметры sambaPrimaryGroupSID: S-1-5-21-1871841520-3204539377-781500168-512
и gidNumber 512
а когда я потом создаю пользователей через smbldap-useradd второй параметр gidNumber у пользователей есть, а первый sambaPrimaryGroupSID нет, почему? чтото я пропустил?
Хотя созданные пользователи в домен входят но как я уже писал выше профиля нет.

#278427
"yok" написал:
хочу чтобы были перемещаемые профили.

Не стоит этого делать. Иначе когда у пользователя будет куча документов на рабочем столе, может получится так, что вход в систему будет сопровождаться очень длительным временем.

#278442
i2ks написал:
Не стоит этого делать. Иначе когда у пользователя будет куча документов на рабочем столе, может получится так, что вход в систему будет сопровождаться очень длительным временем.

Я это понимаю, пользователь будет хранить документы в другом месте. С этим вопросом проблем нет.
Нужно чтобы были перемещаемые избранное и подобные мелочи.

Как же решить вопрос с перемещаемыми профилями, повторяю вопрос первого поста моего?

#278528
"XliN" написал:

Выполнил все там также, но результат тотже.
Ключевое тут это
logon home = \\%L\%U
logon path = \\%L\profile\%U
потом указал
[profile]
path = /cifs/profilе
.....
также права установил
в конфиге smbldap.conf и дублировал и оставлял ""

text
# Just set it to a null string if you want to use the smb.conf 'logon path'

Начинает грузиться винда, появлятся заставка "загрузка личных параметров", но потом пишет не удается найти перемещаемый профиль.

Не может это быть связано с тем что по при создании пользователей почему то нет одного параметра

text
[root@pdc samba]# smbldap-useradd -a testx
[root@pdc samba]# smbldap-passwd testx
Changing UNIX and samba passwords for testx
New password:
Retype new password:
[root@pdc samba]# smbldap-usershow testx
dn: uid=testx,ou=People,dc=sunport,dc=ms
objectClass: top,person,organizationalPerson,inetOrgPerson,posixAccount,shadowAccount,sambaSamAccount
cn: testx
sn: testx
givenName: testx
uid: testx
uidNumber: 10009
gidNumber: 513
homeDirectory: /home/testx
loginShell: /bin/bash
gecos: System User
sambaLogonTime: 0
sambaLogoffTime: 2147483647
sambaKickoffTime: 2147483647
sambaPwdCanChange: 0
displayName: testx
sambaSID: S-1-5-21-1871841520-3204539377-781500168-21018
sambaLMPassword: FB17CE09B5437E0409752A3293831D17
sambaAcctFlags: [u]
sambaNTPassword: F4045A816677A88998D65A6FBFE09970
sambaPwdLastSet: 1349766693
sambaPwdMustChange: 1353654693
userPassword: {SSHA}cUIwTtTUNhdjMpXmYgDMuhXnbgdyVDd0
shadowLastChange: 15622
shadowMax: 45
[root@pdc samba]# id testx
uid=10009(testx) gid=513(Domain Users) группы=513(Domain Users) context=root:system_r:unconfined_t:SystemLow-SystemHigh
[root@pdc samba]#         

а у пользователя который был создан при smbldap-populate , это указанный как админ и созданный автоматически
nobody

text
[root@pdc samba]# smbldap-usershow tirex
dn: uid=tirex,ou=People,dc=sunport,dc=ms
cn: tirex
sn: tirex
objectClass: top,person,organizationalPerson,inetOrgPerson,sambaSamAccount,posixAccount,shadowAccount
gidNumber: 0
uid: tirex
uidNumber: 0
homeDirectory: /home/tirex
sambaLogonTime: 0
sambaLogoffTime: 2147483647
sambaKickoffTime: 2147483647
sambaPwdCanChange: 0
sambaHomePath: \\%L\tirex
sambaHomeDrive: Z:
sambaProfilePath: \\%L\profiles\tirex
sambaPrimaryGroupSID: S-1-5-21-1871841520-3204539377-781500168-512
sambaSID: S-1-5-21-1871841520-3204539377-781500168-500
loginShell: /bin/false
gecos: Netbios Domain Administrator
sambaLMPassword: 5AE2075A34DBE03A944E2DF489A880E4
sambaAcctFlags: [u]
sambaNTPassword: 588C66C88A7EB365BE23480C7884ECB3
sambaPwdLastSet: 1348572696
sambaPwdMustChange: 1352460696
userPassword: {SSHA}FJkpPfnMxgB8/BUyqo0fyIXRIU84ZU9R
shadowLastChange: 15608
shadowMax: 45
[root@pdc samba]# 

получается не создается параметр sambaPrimaryGroupSID
но даже если я пытаюсь зайти пользователем tirex таже история, не может найти перемещаемый профиль.

Подскажите чтож это у меня за причина такая?

Дело в том, что Вашу тему я также использовал для установки контролера.
Сейчас проглядел Вашу тему, и вспомнил что у меня такое, а вы писали это важно и должно быть иначе.
Вот код.

text
[root@pdc samba]# groupadd -g 512 samba_domain_admins
groupadd: GID 512 уже существует
[root@pdc samba]# net groupmap list
Domain Admins (S-1-5-21-1871841520-3204539377-781500168-512) -> Domain Admins
Domain Users (S-1-5-21-1871841520-3204539377-781500168-513) -> Domain Users
Domain Guests (S-1-5-21-1871841520-3204539377-781500168-514) -> Domain Guests
Domain Computers (S-1-5-21-1871841520-3204539377-781500168-515) -> Domain Computers
Administrators (S-1-5-32-544) -> Administrators
Account Operators (S-1-5-32-548) -> Account Operators
Print Operators (S-1-5-32-550) -> Print Operators
Backup Operators (S-1-5-32-551) -> Backup Operators
Replicators (S-1-5-32-552) -> Replicators
Users (S-1-5-32-545) -> 10000
[root@pdc samba]#

Вот наверно поэтому у меня нет параметра для новых юзеров sambaPrimaryGroupSID

попробовал пользователю из phpldapadmina добавить параметр sambaPrimaryGroupSID , но результат тотже.
Не может найти перемещаемый профиль.

Войдите или зарегистрируйтесь, чтобы ответить.