利用Samba-Winbind组件进行Linux加windows域

简介:

设置CentOS的DNS为windows域控的IP地址;
用以下脚本进行加域:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
yum  install  pam_krb5* krb5-libs* krb5-workstation* krb5-devel* krb5-auth samba samba-winbind* samba-client* samba-swat* -y
chkconfig smb on && chkconfig winbind on
mv  /etc/samba/smb .conf  /etc/samba/smb .conf.org
cat  /etc/samba/smb .conf << EOF
       [global]
         workgroup = locallocaldomain
         password server =  dc .localdomain. local 
         realm = localdomain. local 
         security = ads  
         idmap config * : range = 16777216-33554431
         template shell =  /bin/bash
         winbind use default domain =  false
         winbind offline logon =  false
         server string = Samba Server Version % v
         log  file  /var/log/samba/log .%m
         max log size = 50
         load printers = no
     EOF
mv  /etc/krb5 .conf  /etc/krb5 .conf.org
     cat  /etc/krb5 .conf << EOFI
       [logging]
         default = FILE: /var/log/krb5libs .log
         kdc = FILE: /var/log/krb5kdc .log
         admin_server = FILE: /var/log/kadmind .log
       [libdefaults]
         default_realm = localdomain. local 
         dns_lookup_realm =  false
         dns_lookup_kdc =  false
         ticket_lifetime = 24h
         renew_lifetime = 7d
         forwardable =  true
       [realms]
         SL.DX = {
         kdc =  dc .localdomain. local
         admin_server =  dc .localdomain. local
         }
       [domain_realm]
         localdomain. local  = localdomain. local
         .localdomain. local  = localdomain. local
     EOFI
authconfig --updateall --enablewinbind --enablewinbindauth --enablewinbindusedefaultdomain --enablemkhomedir --enableshadow 
service smb restart && service winbind restart
net  join  -U

使用下面的测试加域成功后是否能顺利进行身份认证

1
    wbinfo -t

如果不成功,重新reivew修改配置下面两个文档后,重启winbind和samba两个服务:

1
2
     /etc/samba/smb .conf
     /etc/krb5 .conf




本文转自 bannerpei 51CTO博客,原文链接:http://blog.51cto.com/281816327/1607680,如需转载请自行联系原作者
相关文章
|
2月前
|
Web App开发 安全 Ubuntu
Nexpose 8.13.0 for Linux & Windows - 漏洞扫描
Nexpose 8.13.0 for Linux & Windows - 漏洞扫描
99 3
Nexpose 8.13.0 for Linux & Windows - 漏洞扫描
|
1月前
|
安全 Linux 网络安全
Metasploit Pro 4.22.8-2025080401 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025080401 (Linux, Windows) - 专业渗透测试框架
57 0
|
25天前
|
安全 Linux iOS开发
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
148 0
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
|
25天前
|
安全 Linux 生物认证
Nexpose 8.18.0 for Linux & Windows - 漏洞扫描
Nexpose 8.18.0 for Linux & Windows - 漏洞扫描
36 0
Nexpose 8.18.0 for Linux & Windows - 漏洞扫描
|
26天前
|
安全 Linux iOS开发
SonarQube Server 2025 Release 4.2 (macOS, Linux, Windows) - 代码质量、安全与静态分析工具
SonarQube Server 2025 Release 4.2 (macOS, Linux, Windows) - 代码质量、安全与静态分析工具
101 0
SonarQube Server 2025 Release 4.2 (macOS, Linux, Windows) - 代码质量、安全与静态分析工具
|
29天前
|
NoSQL IDE MongoDB
Studio 3T 2025.14 (macOS, Linux, Windows) - MongoDB 的终极 GUI、IDE 和 客户端
Studio 3T 2025.14 (macOS, Linux, Windows) - MongoDB 的终极 GUI、IDE 和 客户端
109 0
Studio 3T 2025.14 (macOS, Linux, Windows) - MongoDB 的终极 GUI、IDE 和 客户端
|
2月前
|
Linux API iOS开发
Blender 4.5 (Linux, macOS, Windows) - 开源 3D 创意软件 (渲染 建模 雕刻)
Blender 4.5 (Linux, macOS, Windows) - 开源 3D 创意软件 (渲染 建模 雕刻)
117 1
Blender 4.5 (Linux, macOS, Windows) - 开源 3D 创意软件 (渲染 建模 雕刻)
|
2月前
|
安全 Linux iOS开发
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
303 0
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
|
2月前
|
Linux 虚拟化 iOS开发
VMware Workstation 17.6.4 Pro Unlocker & OEM BIOS 2.7 for Windows & Linux
VMware Workstation 17.6.4 Pro Unlocker & OEM BIOS 2.7 for Windows & Linux
484 0
VMware Workstation 17.6.4 Pro Unlocker & OEM BIOS 2.7 for Windows & Linux