Страница 1 из 2
Настройка Samba + Ad?
Добавлено: 2009-02-26 14:07:19
Jabali
Устанавливал по сатье
http://www.lissyara.su/?id=1180 возникло пару вопросов, прошу помочь!
Вопрос 1:
Вот как написано в статье у меня не хотелось подключать
Код: Выделить всё
net ads join -U Administrator
Administrator's password:
[2009/02/26 14:01:40, 0] utils/net_ads.c:ads_startup_int(286)
ads_connect: No logon servers
Failed to join domain: No logon servers
но подключилось вот так
Код: Выделить всё
net rpc join -U Administrator
Password:
Joined domain DOMAIN.
А так можно вообще?
Вопрос 2: После перезагрузки приходится заново проделывать подключение к домену, а можно как то автоматом?
Вопрос 3: Как можно в smb.conf сделать чтобы появлялись папки для зарегистрированных в AD автоматический, такое было для linux пользователей(кстати тоже не напомните как это делалось)?
Вопрос 0.3:
Время почему то не хотелось обновляться вообще небывалый эррор
Код: Выделить всё
net time set -S 192.168.0.1
Thu Feb 26 14:00:23 MSK 2009
/bin/date 200902261400.23 failed. Error was (Unknown error: 0)
Re: Настройка Samba + Ad?
Добавлено: 2009-02-26 14:10:48
atrium
Re: Настройка Samba + Ad?
Добавлено: 2009-02-26 14:18:27
Jabali
atrium писал(а):net join IP_PDC -U users
пробовал явно указывать и через -S тоже
Код: Выделить всё
net join 192.168.0.1 -U Administrator
[2009/02/26 14:16:43, 0] utils/net_ads.c:ads_startup_int(286)
ads_connect: No logon servers
Failed to join domain: No logon servers
ADS join did not work, falling back to RPC...
Joined domain DOMAIN.
Что такое RPC его можно использовать
Re: Настройка Samba + Ad?
Добавлено: 2009-02-26 14:22:39
atrium
Конфиги покажите
nsswitch.conf, smb.conf
Re: Настройка Samba + Ad?
Добавлено: 2009-02-26 15:07:35
Jabali
nsswitch.conf, smb.conf
Код: Выделить всё
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD: src/etc/nsswitch.conf,v 1.1.6.1 2008/11/25 02:59:29 kensmith Exp $
#
group: files winbind
group_compat: nis
hosts: files dns
networks: files
passwd: files winbind
passwd_compat: nis
shells: files
smb.conf
Код: Выделить всё
[global]
workgroup = DOMAIN
realm = DOMAIN.LOCAL
netbios name = Freebsd
server string = Samba Server %v
security = ADS
auth methods = winbind
map to guest = Bad User
password server = 192.168.0.1
printer admin = root
client NTLMv2 auth = Yes
log file = /var/log/samba/log.%m
max log size = 50
client signing = Yes
disable spoolss = Yes
preferred master = No
local master = No
domain master = No
dns proxy = No
idmap uid = 10000-20000
idmap gid = 10000-20000
winbind use default domain = Yes
inherit acls = Yes
hosts allow = 192.168.0.
map acl inherit = Yes
case sensitive = No
nt acl support = yes
os level = 10
socket options = TCP_NODELAY
load printers = yes
printing = cups
printcap name = /etc/printcap
guest account = nobody
guest ok = yes
# debug level = 3
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
use client driver = yes
public = yes
#[tmp]
# comment = Temporary file space
# path = /tmp
# read only = No
# create mask = 0666
# create mode = 666
# directory mode = 666
# directory mask = 0777
# guest ok = Yes
[films]
comment = Films, films, films
path = /usr/samba/files
read list = "@DOMAIN\Domain Users"
write list = "@DOMAIN\Domain Admins"
read only = No
create mode = 666
directory mode = 666
create mask = 0666
directory mask = 0777
Re: Настройка Samba + Ad?
Добавлено: 2009-02-26 16:52:00
atrium
Код: Выделить всё
workgroup=DOMAIN
server string =FreeBSD
netbios name=unix
auth methods=winbind
security =ADS
hosts allow =127.
log file = /var/log/samba/log.%m
max log size =0
log level=0
syslog=0
password server =IP
realm = DOMAIN
encrypt passwords=yes
socket options=SO_RCVBUF=8192 SO_SNDBUF=8192 TCP_NODELAY IPTOS_LOWDELAY
client signing=yes
idmap uid=10000-15000
idmap gid=10000-15000
winbind use default domain=yes
winbind enum users=yes
winbind enum groups=yes
display charset = koi8-r
unix charset = koi8-r
dos charset = cp866
#template homedir=/home/IMPEX/users
#template shell=/bin/csh
interfaces=re0 lo0
bind interfaces only=yes
nt acl support=yes
map acl inherit=yes
inherit acls=no
inherit owner=no
inherit permissions=no
acl check permissions=true
acl map full control=false
block size=4096
client ntlmv2 auth=yes
#minut
deadtime=10
dns proxy=no
follow symlinks=no
Попробуй такой конфиг или добавь недостающие у тебя в конфиги строчки!
Вывод klist покажи!
Re: Настройка Samba + Ad?
Добавлено: 2009-02-26 17:08:33
snorlov
Для начала проверь время, установи его через ntpdate -b 192.168.0.1, расхождение должно быть не более 5-ти минут.
Хотелось взглянуть и на krb5.conf и вывод kinit .
Re: Настройка Samba + Ad?
Добавлено: 2009-02-27 12:39:45
Jabali
snorlov писал(а):Для начала проверь время, установи его через ntpdate -b 192.168.0.1, расхождение должно быть не более 5-ти минут.
Хотелось взглянуть и на krb5.conf и вывод kinit .
По времени вот набрано очень быстро 5 минут разницы точно нет
Код: Выделить всё
Freebsd# ntpdate -b 192.168.0.1
27 Feb 12:35:10 ntpdate[4060]: step time server 192.168.0.1 offset 0.192901 sec
Freebsd# net time set -S 192.168.0.1
Fri Feb 27 12:35:12 MSK 2009
/bin/date 200902271235.12 failed. Error was (Unknown error: 0)
Freebsd# date
Fri Feb 27 12:35:13 MSK 2009
Уф krb5 выглядит так
Код: Выделить всё
[loging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
ticket_lifetime = 24000
default_realm = DOMAIN.LOCAL
dns_lookup_realm = false
dns_lookup_kdc = false
kdc_req_checksum_type = 2
checksum_type = 2
ccache_type = 1
forwardable = true
proxiable = true
[realms]
DOMAIN.LOCAL = {
kdc = 192.168.0.1:88
admin_server = 192.168.0.1:749
default_domain = DOMAIN.LOCAL
}
[domain_realm]
.domain.local = DOMAIN.LOCAL
[pam]
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
[login]
krb4_convert = false
krb4_get_tickets = false
kinit: NOTICE: ticket renewable lifetime is 1 week
Может это ADS/RPS от сервера с ad зависит...
Re: Настройка Samba + Ad?
Добавлено: 2009-02-27 13:05:17
snorlov
В smb.conf добавь в hosts allow еще и локалхост 127.
И перестартуй самбу ....
Re: Настройка Samba + Ad?
Добавлено: 2009-03-02 10:14:52
Jabali
snorlov писал(а):В smb.conf добавь в hosts allow еще и локалхост 127.
И перестартуй самбу ....
добавил
hosts allow = 192.168.0., 127.
перестартанул самбу
Freebsd# /usr/local/etc/rc.d/samba restart
Performing sanity check on Samba configuration: OK
Stopping winbindd.
Stopping smbd.
Stopping nmbd.
Removing stale Samba tdb files: ........ done
Starting nmbd.
Starting smbd.
Starting winbindd.
и тоже самое добавляться через команду ads не добавляется
Freebsd# net ads join -U Administrator
Administrator's password:
[2009/03/02 10:07:16, 0] utils/net_ads.c:ads_startup_int(286)
ads_connect: No logon servers
Failed to join domain: No logon servers
НО после включения freebsd не потребовалось добавлять опять командой rpc уже было всё в домене!
Вопрос: так уж важно добавлять через ads или через rpc тоже можно?

Re: Настройка Samba + Ad?
Добавлено: 2009-03-02 10:44:54
snorlov
Осталось только задать вопрос, а самба была собрана с поддержкой AD?
Re: Настройка Samba + Ad?
Добавлено: 2009-03-02 11:58:11
Jabali
Было выбрано
LDAP
ADS
WINBIND
QUOTAS
UTMP
POPT
PCH
почему нельзя добавлять через rpc?
Re: Настройка Samba + Ad?
Добавлено: 2009-03-02 13:15:18
snorlov
Jabali писал(а):Было выбрано
LDAP
ADS
WINBIND
QUOTAS
UTMP
POPT
PCH
почему нельзя добавлять через rpc?
А rpc работатет, поскольку net join все-таки сработало и добавило машину в домен... С другой стороны билетик от кербероса ты тоже получил... Но вот связки между керберосом и самбой нет....
Re: Настройка Samba + Ad?
Добавлено: 2009-03-02 18:07:45
NN
Re: Настройка Samba + Ad?
Добавлено: 2009-03-03 9:01:24
Jabali
kerberos ставил отдельно из портов (жалко что в статье нет ни слово про то что его надо ставить

) и вроде бы вот судя по этому кака то они с самбой всё таки сожительствуют
Код: Выделить всё
Freebsd# smbd -b | grep KRB
HAVE_KRB5_H
HAVE_ADDR_TYPE_IN_KRB5_ADDRESS
HAVE_CHECKSUM_IN_KRB5_CHECKSUM
HAVE_E_DATA_POINTER_IN_KRB5_ERROR
HAVE_INITIALIZE_KRB5_ERROR_TABLE
HAVE_KRB5
HAVE_KRB5_ADDRESSES
HAVE_KRB5_AUTH_CON_SETKEY
HAVE_KRB5_CRYPTO
HAVE_KRB5_CRYPTO_DESTROY
HAVE_KRB5_CRYPTO_INIT
HAVE_KRB5_DECODE_AP_REQ
HAVE_KRB5_ENCTYPES_COMPATIBLE_KEYS
HAVE_KRB5_FREE_DATA_CONTENTS
HAVE_KRB5_FREE_ERROR_CONTENTS
HAVE_KRB5_GET_DEFAULT_IN_TKT_ETYPES
HAVE_KRB5_GET_KDC_CRED
HAVE_KRB5_GET_PW_SALT
HAVE_KRB5_KEYBLOCK_KEYVALUE
HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK
HAVE_KRB5_KRBHST_GET_ADDRINFO
HAVE_KRB5_KRBHST_INIT
HAVE_KRB5_KT_COMPARE
HAVE_KRB5_KT_FREE_ENTRY
HAVE_KRB5_KU_OTHER_CKSUM
HAVE_KRB5_MK_REQ_EXTENDED
HAVE_KRB5_PRINCIPAL_COMPARE_ANY_REALM
HAVE_KRB5_PRINCIPAL_GET_COMP_STRING
HAVE_KRB5_PRINCIPAL_GET_REALM
HAVE_KRB5_SESSION_IN_CREDS
HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES
HAVE_KRB5_STRING_TO_KEY
HAVE_KRB5_STRING_TO_KEY_SALT
HAVE_KRB5_VERIFY_CHECKSUM
HAVE_LIBKRB5
KRB5_CREDS_OPT_FREE_REQUIRES_CONTEXT
KRB5_PRINC_REALM_RETURNS_REALM
KRB5_VERIFY_CHECKSUM_ARGS
но что то я вно не то
Код: Выделить всё
asu-004# wbinfo -g
должен быть показан список групп
asu-004# wbinfo -u
должен быть показан список юзеров
показывает совсем не то, хотя помнится один раз показал правильно юзеров...
отвечает
Код: Выделить всё
Freebsd# net join -U Administrator
Administrator's password:
[2009/03/03 08:58:32, 0] utils/net_ads.c:ads_startup_int(286)
ads_connect: No logon servers
Failed to join domain: No logon servers
ADS join did not work, falling back to RPC...
Joined domain DOMAIN.
как будто куда то не туда вообще подсоединился... елси вообще подсоелиился
Re: Настройка Samba + Ad?
Добавлено: 2009-03-03 9:30:27
NN
, нормально видит?
попробуй такое
Код: Выделить всё
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD: src/etc/nsswitch.conf,v 1.1 2006/05/03 15:14:47 ume Exp $
#
#group: compat
group_compat: nis
hosts: files dns
networks: files
#passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
passwd: files winbind
group: files winbind
и
Код: Выделить всё
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba,
# read the Samba-HOWTO-Collection. This may be obtained from:
# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the
# Samba-Guide which is generated daily and can be downloaded from:
# http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = STARS
# server string is the equivalent of the NT Description field
server string = ProxyServer
; netbios name = star
# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
security = domain или ADS
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
hosts allow = 192.168. 127.
# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
; load printers = yes
# you may wish to override the location of the printcap file
; printcap name = /etc/printcap
# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool
# system
; printcap name = lpstat
# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
; printing = cups
# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# Put a capping on the size of the log files (in Kb).
max log size = 50
# Use password server option only with security = server
# The argument list may include:
# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
# password server = *
password server = 192.168.1.6
# Use the realm option only with security = ads
# Specifies the Active Directory realm the host is part of
realm = stars.ru
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
passdb backend = tdbsam
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting.
# Note: Consider carefully the location in the configuration file of
# this line. The included file is read at that point.
; include = /usr/local/etc/smb.conf.%m
# Most people will find that this option gives better performance.
# See the chapter 'Samba performance issues' in the Samba HOWTO Collection
# and the manual pages for details.
# You may want to add the following on a Linux system:
; socket options = SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
interfaces = 192.168.1.0/24
# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
local master = no
# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
os level = 0
# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
domain master = no
# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
preferred master = no
# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
domain logons = no
# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
; logon script = %m.bat
# run a specific logon batch file per username
; logon script = %U.bat
# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = \\%L\Profiles\%U
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
; wins support = yes
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = 192.168.1.6
# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
dns proxy = no
# Charset settings
display charset = koi8-r
unix charset = koi8-r
dos charset = cp866
# Use extended attributes to store file modes
; store dos attributes = yes
; map hidden = no
; map system = no
; map archive = no
# Use inherited ACLs for directories
; nt acl support = yes
; inherit acls = yes
; map acl inherit = yes
# These scripts are used on a domain controller or stand-alone
# machine to add or delete corresponding unix accounts
; add user script = /usr/sbin/useradd %u
; add group script = /usr/sbin/groupadd %g
; add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
; delete user script = /usr/sbin/userdel %u
; delete user from group script = /usr/sbin/deluser %u %g
; delete group script = /usr/sbin/groupdel %g
#
winbind separator = +
winbind use default domain = yes
winbind uid = 10000-20000
winbind gid = 10000-20000
winbind enum users = yes
winbind enum groups = yes
template homedir = /home/winnt/%D/%U
template shell = /bin/bash
encrypt passwords = yes
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /usr/local/samba/lib/netlogon
; guest ok = yes
; writable = no
; share modes = no
# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
; path = /usr/local/samba/profiles
; browseable = no
; guest ok = yes
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
;[printers]
; comment = All Printers
; path = /var/spool/samba
; browseable = no
# Set public = yes to allow user 'guest account' to print
; guest ok = no
; writable = no
; printable = yes
# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
[public]
comment = Public Stuff
path = /home/samba
public = yes
writable = yes
printable = no
write list = @staff
шары потом настроиш
в шифрование не лезь
ребутни самбу и потом
Re: Настройка Samba + Ad?
Добавлено: 2009-03-03 12:35:08
snorlov
Jabali писал(а):kerberos ставил отдельно из портов (жалко что в статье нет ни слово про то что его надо ставить

) и вроде бы вот судя по этому кака то они с самбой всё таки сожительствуют
В самой free kerberos уже стоит, поэтому и не было слов про то как его ставить, тебе надо было просто собрать самбу с поддержкой AD и прочего, а так придется пересобирать самбу с указание каталога, где находится библиотеки установленного тобой kerberos'а. Если есть возможность поставь все снова, т.е. саму фрю, затем самбу с соответсвующими опциями
Re: Настройка Samba + Ad?
Добавлено: 2009-03-03 14:37:48
Jabali
Видимо да.. тоесть нет... короче я всё запуттался окончательно..
но помню что без установки kerberosa ни kinit ни net не работало
самбу переустановил с
Код: Выделить всё
cd /usr/ports/net/samba3
make clean
make KRB5_HOME=/usr/local
make install
/usr/local не знаю от куда взялся этот параметр ни чего по krb5 там нету...
вообщем я сдаюсь!
Re: Настройка Samba + Ad?
Добавлено: 2009-03-03 15:29:20
NN
Jabali писал(а):Видимо да.. тоесть нет... короче я всё запуттался окончательно..
но помню что без установки kerberosa ни kinit ни net не работало
самбу переустановил с
Код: Выделить всё
cd /usr/ports/net/samba3
make clean
make KRB5_HOME=/usr/local
make install
/usr/local не знаю от куда взялся этот параметр ни чего по krb5 там нету...
вообщем я сдаюсь!
пересабери самбу так, см. вложения
потом выстави время, за основу возьми мои конфиги nsswitch и smb
ребутни самбу и включай в домен
да и KRB5 удали, он автоматом создасться, вот только не в etc директории
Re: Настройка Samba + Ad?
Добавлено: 2009-03-03 15:30:27
NN
не забудь обновить порты
Re: Настройка Samba + Ad?
Добавлено: 2009-03-03 15:32:47
NN
Jabali писал(а):
Код: Выделить всё
cd /usr/ports/net/samba3
make clean
make KRB5_HOME=/usr/local
make install
вообщем я сдаюсь!
Устанавливай так
Код: Выделить всё
cd /usr/ports/net/samba3
make config
make install clean
Re: Настройка Samba + Ad?
Добавлено: 2009-03-03 17:12:05
Jabali
непомогает
Re: Настройка Samba + Ad?
Добавлено: 2009-03-04 6:31:27
NN
Это твой первый опыт?
тогда воспользуйся советом: snorlov,
Код: Выделить всё
Если есть возможность поставь все снова, т.е. саму фрю, затем самбу с соответсвующими опциями
потом отпишись, я тебе помогу самбу собрать и настроить, только напиши имя домена и IP адреса контролеров.
Re: Настройка Samba + Ad?
Добавлено: 2009-03-06 15:38:55
Alvares
/usr/ports/security/pam_mkhomedir - для создания хомяков юзверей
вот мои конфиги.
АД Вин2003.
Аутентификация по керберос-5.
Все арбайтен зер гут

Re: Настройка Samba + Ad?
Добавлено: 2009-05-15 9:59:33
arkan
В продолжении уже немного подзабытой темы спрошу
А если изначально на
ftp# net time set -S 192.168.100.201
date: send: Permission denied
Fri May 15 13:48:46 NOVST 2009
/bin/date 200905151348.46 failed. Error was (Unknown error: 0)
и может изза этого winbindd незапускается
и в AD подрубить никак неполучается
ftp# net ads join -U Administrator@XXXXXXXX
Enter Administrator@XXXXXX password:
Failed to join domain: failed to find DC for domain XXXXXXX
Даже понять немогу в чем дело
ftp# uname -a
FreeBSD ftp.kit.local 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Wed May 6 10:51:00 NOVST 2009 root@XXXXXXX:/usr/obj/usr/src/sys/mykernel i386
pkg_info samba-3.3.3
А вот когда ставил на 3.3.2 то все было тип топ
И почему время немогу синхронизировать даже и понять немогу
Все конфиги с рабочих серверов все работает на ура
а сейчас нивкакую