利用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,如需转载请自行联系原作者
相关文章
|
13天前
|
人工智能 Linux iOS开发
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
40 12
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
|
1天前
|
数据管理 Linux iOS开发
Splunk Enterprise 9.4.1 (macOS, Linux, Windows) 发布 - 机器数据管理和分析
Splunk Enterprise 9.4.1 (macOS, Linux, Windows) 发布 - 机器数据管理和分析
9 0
Splunk Enterprise 9.4.1 (macOS, Linux, Windows) 发布 - 机器数据管理和分析
|
4天前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.49 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.49 (macOS, Linux, Windows) - 开源渗透测试框架
15 0
Metasploit Framework 6.4.49 (macOS, Linux, Windows) - 开源渗透测试框架
|
3月前
|
安全 网络协议 Linux
telnet在windows和linux上的使用方法
Telnet是一个简单且强大的网络工具,广泛用于远程管理和网络诊断。尽管存在安全风险,但在受控环境中,Telnet仍然是一个非常有用的工具。通过本文的介绍,您应该能够在Windows和Linux系统上安装并使用Telnet进行各种网络操作。
226 18
|
3月前
|
安全 Ubuntu Linux
Metasploit Pro 4.22.6-2024111901 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.6-2024111901 (Linux, Windows) - 专业渗透测试框架
71 9
Metasploit Pro 4.22.6-2024111901 (Linux, Windows) - 专业渗透测试框架
|
5月前
|
Ubuntu 安全 Linux
|
3月前
|
Ubuntu 网络协议 Linux
快速部署WSL(Windows Subsystem for Linux)
WSL提供了一种轻量级的方法,使开发者能够在Windows上无缝运行Linux环境。通过本文介绍的步骤,可以快速安装、配置和使用WSL,以满足开发和测试的需求。
243 8
|
3月前
|
自然语言处理 安全 Java
Nexpose 7.0.1 for Linux & Windows - 漏洞扫描
Nexpose 7.0.1 for Linux & Windows - 漏洞扫描
59 6
|
3月前
|
关系型数据库 MySQL Linux
MySQL数据库下载安装教程(Windows&Linux)
本文档详细介绍了MySQL的安装步骤,包括安装前的准备工作、下载安装包、Windows和Linux系统下的具体安装流程,以及如何配置MySQL服务、设置环境变量、启动服务和连接数据库等关键操作。
|
4月前
|
NoSQL Linux PHP
如何在不同操作系统上安装 Redis 服务器,包括 Linux 和 Windows 的具体步骤
本文介绍了如何在不同操作系统上安装 Redis 服务器,包括 Linux 和 Windows 的具体步骤。接着,对比了两种常用的 PHP Redis 客户端扩展:PhpRedis 和 Predis,详细说明了它们的安装方法及优缺点。最后,提供了使用 PhpRedis 和 Predis 在 PHP 中连接 Redis 服务器及进行字符串、列表、集合和哈希等数据类型的基本操作示例。
169 4