samba服务器加入域控主机所需要修改的配置文件

samba服务器加入域控主机,成为域成员,当用户访问samba服务器上的共享文件时,直接到域控主机上进行认证。samba服务器上不需要像先前一样创建系统用户,创建samba用户及密码。

1、安装环境(host)

SAMBA服务器:RHEL6.4      IP:192.168.1.101  主机名:sambaserver.samba.com

域控主机WINSERVER2008  IP:192.168.1.100  主机名:winserver.samba.com 域名:SAMBA.COM

设置SElinux的运行级别为disabled,关闭防火墙,修改samba服务器主机名为域名形式,修改IP地址为同一网段,并且设置DNS为域控主机IP。

vi /etc/sysconfig/network

NETWORKING=yes
  HOSTNAME=netfolderserver.iamtest.com

vi /etc/hosts
127.0.0.1    sambaserver.samba.com     sambaserver
192.168.1.101    sambaserver.samba.com    sambaserver
192.168.1.100    winserver.samba.com      winserver

[[email protected]]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 

DEVICE=eth0
TYPE=Ethernet
UUID=be9c85bd-3292-4b5a-96b9-9aed2bc61ce2
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=01:A1:53:94:55:A6
IPADDR=192.168.1.101
PREFIX=25
GATEWAY=192.168.1.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
DNS1=192.168.1.100

2、smb.conf配置

#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name
    workgroup = SAMBA     #####域名前半部分,不要加.com
    netbios name = sambaserver
# server string is the equivalent of the NT Description field
   server string = sambaServer.SAMBA ###这个名字可随意,不要跟其它服务器重名即可

realm = SAMBA.COM --------域名
auth methods = winbind
idmap config SAMBA : schema_mode = rfc2307
idmap config SAMBA : range = 30000-40000
idmap config SAMBA : default = yes
idmap config SAMBA : backend = rid
;idmap config SAMBA : backend = ad
idmap config * : backend = tdb
idmap config * : backend = rid
idmap config * : range = 10000-20000
winbind nss info = rfc2307
winbind trusted domains only = no
winbind enum groups = yes
winbind enum users = yes
winbind separator = /
winbind use default domain = yes
template homedir = /home/share/%U
template shell = /bin/bash

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

# Security mode. Most people will want user level security. See
# security_level.txt for details.
   security = ads
   encrypt passwords = yes
# Use password server option only with security = server
   password server = 192.168.1.100 #域控主机IP

   logon path = \\%L\Profiles\%U

# 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.100  #域控主机IP

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
   dns proxy = no
#============================ Share Definitions ==============================
[homes]
   path = /home/share/%U
   valid users = SAMBA.COM\%U, SAMBA\%U, %U
   create mode = 0777
   directory mode = 0777
   comment = Home Directories
   browseable = no

# 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

[MyFile]
comment        = user
path        = /home/share/%U
browseable    = yes
guest ok    = no
writable    = yes
printable    = no
public        = no

3、krb5.conf

[logging]
 default = FILE:/var/log/krb5libs.log
 kdc = FILE:/var/log/krb5kdc.log
 admin_server = FILE:/var/log/kadmind.log

[libdefaults]
 default_realm = SAMBA.COM
 dns_lookup_realm = false
 dns_lookup_kdc =false
 ticket_lifetime = 24h
 forwardable = yes
 proxiable = true

[realms]
 SAMBA.COM = {
  kdc = winserver.samba.com :88
  admin_server = winserver.samba.com :749
  default_domain = SAMBA.COM
 }

#[kdc]
# profile = /var/kerberos/krb5kdc/kdc.conf 

[domain_realm]
.iamtest.com = SAMBA.COM
 iamtest.com = SAMBA.COM[appdefaults]
 pam = {
   debug = false
   ticket_lifetime = 36000
   renew_lifetime = 36000
   forwardable = true
   krb4_convert = false
 }

4、resolve.conf

vi /etc/resolv.conf # Generated by NetworkManager
domain samba.com
search samba.com
nameserver 192.168.1.100

5、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 winbind
shadow:     files winbind
group:      files winbind

hosts:     files dns wins
#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:     db files
netmasks:   files
networks:   files dns
protocols:  db files
#protocols:   files winbind
rpc:        db files
services:   db files
#services:   files winbind

netgroup:   nisplus winbind
#netgroup:    files winbind

publickey:  nisplus

automount:  files nisplus
#automount:   files winbind
aliases:    files nisplus

6、samba服务器加入域控主机

6.1 启动samba程序 /usr/local/samba3/sbin/smbd -s /etc/samba/smb.conf -D -d 3

6.2 启动winbind: service winbind start  检查winbind运行状态:service winbind status

6.3 加入域控主机: net ads join -U administrator, 输入域控主机的域管理员账号密码,正常的话会提示加入域成功。

6.4 测试加入域: wbinfo -t 检查samba服务器和域控主机之间的信任关系; wbinfo -u 读取域控主机上所有用户的信息;wbinfo -g 读取域控主机上的用户组信息。

时间: 2024-08-14 18:49:56

samba服务器加入域控主机所需要修改的配置文件的相关文章

samba服务器详细配置(非域模式)

组成Samba运行的有两个服务,一个是SMB,另一个是NMB:SMB是Samba 的核心启动服务,主要负责建立Samba服务器与Samba客户机之间的对话,验证用户身份并提供对文件和打印系统的访问,只有SMB服务启动,才能实现文件的共享,监听139 TCP端口:而NMB服务是负责解析用的,类似与DNS实现的功能,NMB可以把Linux系统共享的工作组名称与其IP对应起来,如果NMB服务没有启动,就只能通过IP来访问共享文件,监听137和138 UDP端口. Samba服务器可实现如下功能: A.

2003域控升级为2008域控步骤。

一.总体步骤 1.1.将2003域控进行架构扩展,以便2008域控能加入原有2003域控所在的林. 1.2.安装2008操作系统,并加入域,然后将该2008升级为域控,并加入现有林中的2003域. 1.3.在新的2008域上进行一系列操作,将各种角色转移到2008域控. 1.4.对原有2003域控进行降级. 2003域控为:DC01.dc.local 2008域控为:DC02.dc.local 二.详细步骤 2.1.提升现有2003"域功能级别"和"林功能级别".

域控NTP时间同步问题

1)首先确认虚拟化底层的时间是否准确,因为所有虚拟机会自动同步虚拟主机的时间. 2)在所有AD服务器上开启时间同步功能 一.找到适合的NTP服务器 首先需要找一个适合自己网络环境的NTP服务器,因为不同的网络会有不同的NTP服务器起作用,检测NTP服务器的方法为在AD上运行w32tm /stripchart /computer:以下NTP服务器的名字,如w32tm /stripchart /computer:s1a.time.edu.cn,若是可以使用会显示如下图 若是不可用会显示如下图 二.C

Windows server 2012 域控制器之间角色转移及清理域控方法,实现辅助域控提升为主域控

本章博文讲述Windows server 2012 域控制器之间角色转移及删除域控方法 .针对不同的应用场景,对操作方法进行了归纳与总结   . 下面分2种场景做介绍  : 场景1:主域控制器与辅助域控制器运行正常,相互间可以实现AD复制功能.需要把辅助域控制器提升为主域控制器 ,把主域控制器降级为普通成员服务器:这种场景一般应用到原主域控制器进行系统升级(先转移域角色,再降级,再安装或升级高版本系统,再次转移角色恢复到主域控制器角色)或使用配置更高的服务器替代原主域控制器起到主域控制的作用(使

域控2008R2升级到2016

近日因需要迁移域控2008R2至2016.做了以下测试,现在分享给大家参考,如有设置不对的地方,欢迎指正.依此测试成功对域控做了迁移升级. 名称:ADGCDCDNSDHCP 使用到的命令:netdom query fsmopingdcdiagdcpromommcRegsvr32 升级域控之前请先在域控服务器上 运行-cmd-dcdiag.利用dcdiag命令查看域控的信息,确保最好是所有测试都是通过状态. 查看当前域功能的级别,林功能的级别. 查看主DNS,辅DNS 查看DHCP 测试环节如下:

windows2008域控降低后修正administrator.000用户配置文件

域控降级后administrator用户的配置文件默认改成了administrator.000,修复方式 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-2388727721-4222903185-2526723306-500,以-500或-500.bak结束的基本是域控管理员或系统管理员,找到ProfileImagePath值C:\Users\Administrator\a

在域环境下搭建samba服务器

环境: samba:smbserver: 192.168.0.18 AD:rise.com:192.168.0.37 组:zixun  xingzheng  teacher  class  admin 共享目录:zixun  xingzheng  xueshu  other 一.安装Samba服务器 yum install -y samba 二.把linux加入到ad中 1.先复制/etc/krb5.conf配置文件为 cp /etc/krb5.conf /etc/krb5.conf1 打开/e

用源码编译安装Samba 4.8.2做域控

Samba 4.8.2发布了,再次用源码包编译安装一下测试做域控. 10.0.0.10 Centos7 1708 64 bit 10.0.0.11 Win 10 RSAT 首先修改一下主机名 [[email protected] ~]# vi /etc/hostname dc01.contoso.com [[email protected] ~]# vi /etc/hosts 127.0.0.1   localhost localhost.localdomain localhost4 local

进击 office web apps 部署-搭建域控服务器

开始第一条先说注意事项:我所配置的环境是用了三台2012server虚拟机,三台虚拟机必须要加下域控,而且登录操作的时候必须以域账号登录,否则测试不通过!在笔记本上搭建了两个虚拟机(window server 2012),一个作为AD服务器,即域控服务器,一个作为web apps server服务器,本机作为web应用服务器. 一.搭建域控服务器 首先,打开“服务器管理器”,点击“添加功能和角色”. 进入“添加角色和功能向导”,检查到静态IP地址(为192.168.100.100)已配置完成,管