linux samba 配置ldap认证,用于Samba 的基于LDAP 的身份验证-2-Fedora Core3

[root@linus sbin]# ./configure.pl

If you need to change this, enter the full directory path, then press enter to continue.

Smbldap-tools Configuration Directory Path [/etc/opt/IDEALX/smbldap-tools/] >

/var/lib/samba/sbin

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Let's start configuring the smbldap-tools scripts ...

. workgroup name: name of the domain Samba act as a PDC

workgroup name [BIGTIME] >

. netbios name: netbios name of the samba controler

netbios name [linus] >

. logon drive: local path to which the home directory will be connected (for NT

Workstations). Ex: 'H:'

logon drive [H:] >

. logon home: home directory location (for Win95/98 or NT Workstation).

(use %U as username) Ex:'\linus%U'

logon home (press the "." character if you don't want homeDirectory) [\linus%U]

> .

. logon path: directory where roaming profiles are stored. Ex:'\linusprofiles%U'

logon path (press the "." character if you don't want roaming profile)

[\linusprofiles%U] > .

. home directory prefix (use %U as username) [/home/%U] >

. default users' homeDirectory mode [700] >

. default user netlogon script (use %U as username) [%U.cmd] > ""

default password validation time (time in days) [45] >

. ldap suffix [dc=somedomain,dc=com] >

. ldap group suffix [ou=Groups] >

. ldap user suffix [ou=Users] >

. ldap machine suffix [ou=Computers] >

. Idmap suffix [ou=Idmap] >

. sambaUnixIdPooldn: object where you want to store the next uidNumber

and gidNumber available for new users and groups

sambaUnixIdPooldn object (relative to ${suffix}) [sambaDomainName=BIGTIME] >

. ldap master server: IP adress or DNS name of the master (writable) ldap server

ldap master server [127.0.0.1] >

. ldap master port [389] >

. ldap master bind dn [cn=Manager,dc=somedomain,dc=com] >

. ldap master bind password [] >

. ldap slave server: IP adress or DNS name of the slave ldap server: can also be the

master one

ldap slave server [127.0.0.1] >

. ldap slave port [389] >

. ldap slave bind dn [cn=Manager,dc=somedomain,dc=com] >

. ldap slave bind password [] >

. ldap tls support (1/0) [0] > 1

. How to verify the server's certificate (none, optional or require) [require] >

. CA certificate file [/var/lib/samba/sbin//ca.pem] > /etc/openldap/cacerts/cacert.pem

. certificate to use to connect to the ldap server

[/var/lib/samba/sbin//smbldap-tools.pem] >

. key certificate to use to connect to the ldap server

[/var/lib/samba/sbin//smbldap-tools.key] >

. SID for domain BIGTIME: SID of the domain (can be obtained with

'net getlocalsid linus')

SID for domain BIGTIME [S-1-5-21-1030832020-2822878261-2997333186] >

. unix password encryption: encryption used for unix passwords

unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA) [SSHA] > MD5

. default user gidNumber [513] >

. default computer gidNumber [515] >

. default login shell [/bin/bash] >

. default skeleton directory [/etc/skel] >

. default domain name to append to mail adress [] > somedomain.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

backup old configuration files:

/var/lib/samba/sbin/smbldap.conf->/var/lib/samba/sbin/smbldap.conf.old

/var/lib/samba/sbin/smbldap_bind.conf->/var/lib/samba/sbin/smbldap_bind.conf.old

writing new configuration file:

/var/lib/samba/sbin/smbldap.conf done.

/var/lib/samba/sbin/smbldap_bind.conf done.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Samba 支持通过 LDAP 认证,你可以使用下面的指令来实现:security = user passdb backend = ldapsam:ldap://<IP address of your LDAP server> ldap suffix = dc=<your domain>,dc=com ldap user suffix = ou=Users ldap group suffix = ou=Groups ldap machine suffix = ou=Computers ldap ssl = start tls ### 回答2: Samba是一种开放源代码的实现服务,它允许Linux操作系统作为服务器提供文件和打印服务,同时也可以与Windows客户端进行互操作。LDAP(轻量目录访问协议)是一种用于访问分布式目录服务的协议,用于在网络上存储和检索信息。在Samba中,可以使用LDAP进行用户认证。 要通过LDAP认证配置Samba,需要进行以下步骤: 1.安装和配置OpenLDAP:首先需要安装OpenLDAP服务器并进行相应的配置。可以使用适合你的操作系统的软件包管理器安装OpenLDAP。 2.创建LDAP数据库:在OpenLDAP服务器上创建一个LDAP数据库,该数据库将存储用户和组的信息。使用类似slapadd、ldapadd等工具导入LDAP数据库架构和数据。 3.配置smb.conf文件:打开smb.conf文件,该文件一般位于"/etc/samba"目录下。添加以下配置参数: ``` [global] ... security = user passdb backend = ldapsam:ldap://localhost ldap suffix = dc=example,dc=com ldap user suffix = ou=users ldap group suffix = ou=groups ldap machine suffix = ou=machines ... ``` 这些参数告诉Samba使用LDAP进行用户认证,并指定LDAP服务器的地址以及相应的LDAP数据库的相关信息。 4.创建Samba用户和组:通过LDAP工具(如ldapadd、ldapmodify等)在LDAP数据库中创建Samba用户和组。 5.重新启动Samba服务:完成配置后,重新启动Samba服务以使更改生效。可以使用类似于"systemctl restart smbd"的命令来重启服务。 配置完成后,Samba将使用LDAP服务器进行用户认证。当Windows客户端尝试登录Samba共享时,Samba将使用LDAP验证用户名和密码,并根据指定的访问权限授予或拒绝访问。 这些是通过LDAP进行Samba认证的基本步骤,具体的指令和命令可能会因系统和环境的不同而有所差异,需要根据实际情况进行调整。 ### 回答3: Samba是一个开源软件套件,可实现文件共享和打印服务,而LDAP(轻量级目录访问协议)是一种用于访问目录服务的协议。Samba可以通过LDAP进行用户认证。 要配置Samba以使用LDAP进行认证,我们需要采取以下步骤: 1. 配置LDAP服务器:首先,需要设置和配置LDAP服务器。这可以通过安装和配置LDAP服务器软件,例如OpenLDAP或Microsoft Active Directory,来实现。 2. 配置Samba服务器:然后,在Samba服务器上进行配置。我们需要编辑Samba配置文件(通常位于/etc/samba/smb.conf),以便将其与LDAP集成。 3. 启用LDAP认证:在Samba配置文件中,我们需要启用LDAP认证选项。可以使用以下指令: `ldap password sync = yes` `ldap suffix = "dc=example,dc=com"` `ldap user suffix = "ou=users"` `ldap group suffix = "ou=groups"` `ldap machine suffix = "ou=computers"` 这些指令指定了LDAP服务器的相关信息,例如服务器的后缀、用户、组和计算机的组织单元等。 4. 配置LDAP认证参数:在Samba配置文件中,我们还需要添加LDAP服务器的连接和身份验证参数。下面是一些示例指令: `ldap server = ldap.example.com` `ldap port = 389` `ldap admin dn = "cn=admin,dc=example,dc=com"` `ldap ssl = start_tls` 这些指令告诉Samba服务器要连接的LDAP服务器的位置、端口号、管理员DN以及是否使用SSL/TLS加密连接。 5. 重启Samba服务:在完成Samba配置文件的修改后,我们需要重启Samba服务器以使更改生效。可以使用以下指令重启Samba服务: `service smbd restart` `service nmbd restart` 通过以上步骤,我们可以使用Samba通过LDAP认证用户。当用户尝试通过Samba访问共享文件夹或打印机时,Samba服务器将使用LDAP来验证其身份,并根据LDAP上的访问权限控制用户的访问行为。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值