samba 做簡單域控

samba做簡單域控

看到論壇上有些人在討論用samba做域控制器的問題,其實我個人認爲真正做網路管理的話,AD是不二的選擇

功能全而且強大,如想熟悉哈linux,自己玩哈還是可以的,將本次實驗的過程貼出來,歡迎大家來踩!!

本實驗的功能非常簡單,只是將windows加入到了域中,管控功能沒有,就連客戶端關機的權利也沒有,希望有高人指點!email:[email protected]

關閉iptables、selinux

  [root@mycentos ~]# rpm -qa |grep samba
samba-common-3.0.33-3.28.el5
samba-client-3.0.33-3.28.el5
samba-3.0.33-3.28.el5
[root@mycentos ~]#

smb.conf 配置如下


[global]
        workgroup = max.com       #域名
        server string = Samba Server Version %v
        netbios name = mycentos   #主機名
        interfaces = eth0
        hosts allow = 127. 192.168.12. 192.168.0.
# --------------------------- Logging Options -----------------------------
        # logs split per machine;
        log file = /var/log/samba/%m.log
        # max 50KB per log file, then rotate;
        max log size = 50
# ----------------------- Domain Controller Options ------------------------
        security = user

        passdb backend = tdbsam
        domain master = yes
        domain logons = yes
        logon script =startup.bat  #當client登陸時映射到本地的目錄
# ----------------------- Browser Control Options ----------------------------
        local master = no
        os level = 200
        preferred master = yes
#============================ Share Definitions ==============================
[share]
        comment = share
        path = /home/samba
        browseable = yes
        public = yes

[homes]
        comment = Home Directories
        browseable = no
        writable = yes
;       valid users = %S
;       valid users = MYDOMAIN\%S
# Un-comment the following and create the netlogon directory for Domain Logons
        [netlogon]                                  #存放startup.bat 的文件夾
        comment = Network Logon Service
        path = /home/samba/netlogon
        guest ok = yes
        writable = no
        share modes = no
        follow symlinks=yes


 

  mkdir -p /home/samba/netlogon

  

   在netlogon中touch starup.bat文件

[root@mycentos ~]# cat /home/samba/netlogon/startup.bat
net time \\mycentos /set /yes
net use k: \\mycentos\share    
  #將share 掛載爲client的k盤

[root@mycentos ~]# unix2dos /home/samba/netlogon/startup.bat    # 轉換爲windows格式

 

groupadd machine                                                              #創建機器組

useradd  -g machine -s /bain/false -d /dev/null jf1$     # 增加機器用戶(jf1爲計算機名)

smbpasswd -a -m jf1$                                                       #加機器用戶t到samba密碼中

smbpasswd -a root                                                             #並非liunx系統用戶,是client加入域時需要

useradd -a zz                                                                        #真正的登陸用戶

smbpasswd -a zz

 

 

啓動samba服務:


  [root@mycentos ~]# tail /var/log/messages
Dec  4 20:50:31 mycentos nmbd[7529]:   Attempting to become domain master browser on workgroup MAX.COM on subnet 192.168.0.200
Dec  4 20:50:31 mycentos nmbd[7529]: [2010/12/04 20:50:31, 0] nmbd/nmbd_become_dmb.c:become_domain_master_browser_bcast(303)
Dec  4 20:50:31 mycentos nmbd[7529]:   become_domain_master_browser_bcast: querying subnet 192.168.0.200 for domain master browser on workgroup MAX.COM

測試:

 

 

 

 

 

 

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章