如何使用Active Directory来validationLinux用户

使用Active Directory在Linux(Debian)框中validation用户的最佳做法是什么?

我希望它的工作方式是将AD用户添加到一个组 – 比如说Linuxpipe理员或者Linuxnetworking服务器 ,并且根据他们的组成员身份,他们将/不会被授予对特定服务器的访问权限。 理想情况下,根帐户将是唯一以标准方式维护的帐户。

我这样做的目标如下:

  • 允许在一个地方更改密码
  • 自动授予某些人使用他们的AD证书访问Linux服务器
  • 将我们所有的用户信息整合到一个数据库中

我想避免的事情是:

  • 任何困难/反直觉为我们的活动目录pipe理员pipe理
  • 如果AD服务器由于某种原因而无法访问,则将用户locking(即,它需要以某种方式caching凭证)
  • 任何太复杂或者不标准的东西,下次我升级服务器时都会中断。

另请参阅Windows域上的Linux客户端以及如何根据AD对Linux服务器进行身份validation?

您正在寻找的软件被称为“同样开放”。

从他们的页面:

  • 通过命令行或GUI从一个步骤将非Windows系统连接到Active Directory域
  • 在Windows和非Windows上使用单一用户名和密码对用户进行身份validation
  • 对非Windows用户和Windows用户实施相同的密码策略
  • 支持单向和双向交叉森林信托的多个森林
  • caching凭据,以防您的域控制器closures
  • 为SSH和腻子提供单一login
  • 支持Kerberos,NTLM和SPNEGO的下一代身份validation引擎
  • 不需要对Active Directory进行架构更改

我们已经在一些机器上使用它,它似乎运作良好。

http://www.likewise.com/products/likewise_open/

我用同样的开放,发现它是越野车,不是很可靠。 去年,我转而使用Centrify,既用于Linux,也用于Mac,而且根本不用瞎搞。 我更喜欢Centrify的conf文件configuration到需要使用外部工具进行操作的Likewise-Open的registry文件configuration。

http://www.centrify.com/express/free-active-directory-tools-for-linux-mac.asp

您没有理由在大多数发行版上使用任何外部软件。

对于Debian / Ubuntu,您可以使用libnss-ldap和libpam-krb5来完成。 有一些技巧可以让它达到100%。 假设你已经为Linux用户填充了“unixHomeDirectory”,你的Linux机器正在使用你的Windows系统的NTP(Kerberos所要求的),并且你可以使用纯文本NSS查找(不是密码,而是组员信息等)使用TLS,但设置更复杂)。 除非您设置为使用TLS,否则您不应将pam_ldap作为PAM中的密码或授权来源。

/etc/ldap.conf中用

# LDAP Configuration for libnss-ldap and libpam-ldap. # Permit host to continue boot process with out contacting LDAP server bind_policy soft # Define LDAP servers to use for queries, these must be Global Catalog servers uri ldap://ldap.site.company.local # Define root search location for queries base dc=company,dc=local #debug 1 # LDAP version, almost always going to be v3, it is quite mature ldap_version 3 # Username used to proxy authentication. You can have this in a separate file owned by root for security OR use TLS/SSL (see man page) # Do NOT use LDAP for authentication if you are using plain text binds, use Kerberos instead (and LDAP for authorization only). See libpam-krb5. binddn cn=ldap-auth-svc,ou=ldap,ou=services,dc=site,dc=company,dc=local # Password for proxy acct bindpw SooperSekeretPazzwerd # TCP port to perform queries on, 3268 is a Global Catalog port which will reply for all users in *.company.local port 3268 # Search range scope (sub = all) scope sub # Tell the client to close TCP connctions after 30 seconds, Windows will do this on the server side anyways, this will prevent errors from showing up in the logs. idle_timelimit 30 # Expect queries for group membership to return DN for group members instead of usernames (lets you use MSAD group membership seamlessly) nss_schema rfc2307bis # Filters - User accounts must have a UID >= 2000 to be recognized in this configuration and must have a unixHomeDirectory defined. nss_base_group dc=company,dc=local?sub?&(objectClass=group)(gidNumber=*) nss_base_user dc=company,dc=local?sub?&(objectClass=user)(!(objectClass=localputer))(uidNumber>=2000)(unixHomeDirectory=*) nss_base_shadow dc=company,dc=local?sub?&(objectClass=user)(!(objectClass=localputer))(uidNumber>=2000)(unixHomeDirectory=*) # Object Class mappings. You may want to have the posixAccount to map to "mail" and have users login with their email addresses, ie "nss_map_objectclass posixAccount mail". nss_map_objectclass posixAccount user nss_map_objectclass shadowAccount user nss_map_objectclass posixGroup group # Attribute mappings. nss_map_attribute uniqueMember member nss_map_attribute uid sAMAccountName nss_map_attribute homeDirectory unixHomeDirectory nss_map_attribute shadowLastChange pwdLastSet # Attribute in LDAP to query to match the username used by PAM for authentication pam_login_attribute sAMAccountName # Filter for objects which are allowed to login via PAM pam_filter objectclass=User 

假设您的Linux机器使用的是知道AD的DNS服务器,则不需要编辑/etc/krb5.conf(具有相应SRVlogging的_msdcs区域是可parsing的)

/etc/nsswitch.conf应该有用于用户,组,影子的“files ldap”。

对于使用SSSD的红帽:

/etc/sssd/sssd.conf

 [domain/AD] id_provider = ldap auth_provider = krb5 chpass_provider = krb5 access_provider = ldap ldap_uri = ldap://ldap.company.local:3268/ ldap_search_base = dc=company,dc=com ldap_default_bind_dn = cn=ldap-auth-svc,ou=ldap,ou=services,dc=site,dc=company,dc=local ldap_default_authtok = SooperSekeretPazzwerd ldap_schema = rfc2307bis ldap_user_object_class = user ldap_group_object_class = group ldap_user_name = sAMAccountName ldap_user_home_directory = unixHomeDirectory enumerate = true ldap_tls_reqcert = never ldap_tls_cacertdir = /etc/openldap/cacerts ldap_id_use_start_tls = False cache_credentials = True krb5_realm = SITE.COMPANY.COM case_sensitive = false [sssd] services = nss, pam config_file_version = 2 domains = AD [nss] filter_users = root,named,avahi,nscd 

你应该评估半径。 configurationLinux机箱以使用pam-radius并安装MS半径插件NPS。 它会和AD交谈。 您可以在这里获得pdf格式的概述: http : //www.wikidsystems.com/learn-more/two-factor-authentication-white-papers (no reg)。 只要忽略双因素authentication位。