web-dev-qa-db-ja.com

LinuxサーバーをADに対して認証することはどれほど実用的ですか?

ソフトウェア開発会社では、WindowsサーバーとLinuxサーバーの両方を利用しています。

このセットアップの問題点の1つは、シングルサインオンソリューションがないことです。 Linuxショップではなくマイクロソフトショップであり、ADに対して認証したい。

私はオンラインでいくつかの記事を読み、これが可能であることを理解しています。

現在、認証が必要なLinuxで次のサービスを使用しています。
-gitサーバー(SSH経由)
-Sendmail
-現在.htaccessファイルを使用しているApache Webサーバー。
-SAMBAファイル共有

私が知りたいのは、この種のセットアップがどれほど実用的であるか?それは本当に機能するのか、それともエラーが発生しやすいのか?

18
Philip Fourie

それは難しくなく、完全に実用的です。

AD authを使用する数百のデュアルブートデスクトップマシンと、AD authを使用して、Windowsクライアントがユーザーによる明示的な認証なしにsamba共有を使用できるようにするいくつかのサーバーがあります。

あなたがする必要があることについてSFに関する別の記事がありました。

基本的に、kerberos、winbind、nss、pamを設定する必要があります。

次に、kinitnet ads joinを実行します。

必要に応じて、複数の認証方法を使用するようにpamを構成できます。そのため、1つが機能しない場合は、次の方法にフォールバックします。

通常、Windowsサーバーへのファイル共有を提供するサーバーには、winbinddおよびldapファイルを使用します。

可能であれば、アカウント情報にはLDAPを使用し、認証には厳密にwindbindを使用しますが、必要に応じて/etc/ldap.confで属性をマップできると思います。最終的にアカウント情報にwinbinddを使用する場合は、RID(ハッシュ方式)を使用してuid/gidsを生成できますが、他の方法を使用することもできます。 1つの大きなファイルサーバーでRIDを使用しましたが、それは本当に大変だったので、可能であれば他のオプションの1つを試してみます。今回のケースでは、すべてのADユーザーとグループが上流のIDMシステムによってLDAPに反映されるため、新しいサーバーのアカウント情報にはLDAPを使用し、純粋に認証にはwinbindを使用します。

11
Jason Tan

Like Openを使用すると、認証は非常に簡単です。 http://www.likewise.com/products/likewise_open/index.php

Linuxインフラストラクチャのほぼ全体で、Like Like Openのおかげで認証とユーザー管理が一元化されています。インストールと実装は驚くほど簡単です。それについては十分とは言えない。

注意として、UIDとGIDはハッシュ関数に従って割り当てられるため、インフラストラクチャ全体で同一であるため、NFSマウントは完全に機能します。

6
Matt Simmons

Sambaを使用する必要はありません。ADはKerberosとLDAPを直接サポートしています。ほとんどのディストリビューションで外部ソフトウェアを使用する理由はありません。

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, i.e.  "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を編集する必要はありません(適切なSRVレコードを含む_msdcsゾーンは解決可能です)。

/etc/nsswitch.confには、ユーザー、グループ、シャドウ用の「ファイルLDAP」が必要です。

SSSDを使用するRed Hatの場合:

/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
2
TheFiddlerWins

WindowsユーザーがADに対して認証を取得しましたが、ほとんどのサーバー(パブリックドライブなど)はLinuxであり、ドメインの一部です。窓からPoV誰も気づかない。私の側から見ると、それは私のWindowsユーザー名で少しフルーティーなsshをしているように感じますが、それはそれのサイズとほぼ同じです。

単純な古いサンバを使用するだけです。

2
Tom Newton