Active Directory ドメインに参加する2019/07/12 |
Windows の Active Directory ドメインに参加します。
LAN 内に Windows Active Directory Domain Service が稼働していることが前提です。
ここでは例として、以下のような Active Directory ドメイン環境で設定します。
|
|||||||||||
[1] | 必要なものをインストールしておきます。 |
root@dlp:~#
apt -y install realmd sssd sssd-tools adcli krb5-user packagekit samba-common samba-common-bin samba-libs # DHCP 使用中の場合は [Yes], そうでない場合は [No] +----------------------+ Samba server and utilities +-----------------------+ | | | If your computer gets IP address information from a DHCP server on the | | network, the DHCP server may also provide information about WINS servers | | ("NetBIOS name servers") present on the network. This requires a change | | to your smb.conf file so that DHCP-provided WINS settings will | | automatically be read from /var/lib/samba/dhcp.conf. | | | | The dhcp-client package must be installed to take advantage of this | | feature. | | | | Modify smb.conf to use WINS settings from DHCP? | | | | <Yes> <No> | | | +---------------------------------------------------------------------------+ # レルム名を指定 +------------------+ Configuring Kerberos Authentication +------------------+ | When users attempt to use Kerberos and specify a principal or user name | | without specifying what administrative Kerberos realm that principal | | belongs to, the system appends the default realm. The default realm may | | also be used as the realm of a Kerberos service running on the local | | machine. Often, the default realm is the uppercase version of the local | | DNS domain. | | | | Default Kerberos version 5 realm: | | | | SRV.WORLD________________________________________________________________ | | | | <Ok> | | | +---------------------------------------------------------------------------+ # AD DS のホスト名を指定 +------------------+ Configuring Kerberos Authentication +------------------+ | Enter the hostnames of Kerberos servers in the SRV.WORLD Kerberos realm | | separated by spaces. | | | | Kerberos servers for your realm: | | | | fd3s.srv.world___________________________________________________________ | | | | <Ok> | | | +---------------------------------------------------------------------------+ # AD DS のホスト名を指定 +------------------+ Configuring Kerberos Authentication +------------------+ | Enter the hostname of the administrative (password changing) server for | | the SRV.WORLD Kerberos realm. | | | | Administrative server for your Kerberos realm: | | | | fd3s.srv.world___________________________________________________________ | | | | >Ok< | | | +---------------------------------------------------------------------------+ |
[2] | Active Directory ドメインに参加します。 |
nameserver
10.0.0.100
root@dlp:~#
vi /etc/pam.d/common-session # 必要があれば、最終行に追記 ( ログイン時にホームディレクトリを自動作成 ) session optional pam_mkhomedir.so skel=/etc/skel umask=077 # Active Directory ドメインを discover する root@dlp:~# realm discover SRV.WORLD srv.world type: kerberos realm-name: SRV.WORLD domain-name: srv.world configured: no server-software: active-directory client-software: sssd required-package: sssd-tools required-package: sssd required-package: libnss-sss required-package: libpam-sss required-package: adcli required-package: samba-common-bin # Active Directory ドメインに join する root@dlp:~# realm join SRV.WORLD Password for Administrator: # AD の Administrator パスワード
# 任意の AD ユーザーの情報が取得できるか確認 root@dlp:~# id FD3S01\\Serverworld uid=880001106(serverworld@srv.world) gid=880000513(domain users@srv.world) groups=880000513(domain users@srv.world),880000572(denied rodc password replication group@srv.world),880000512(domain admins@srv.world) # 任意の AD ユーザーに遷移可能か確認 root@dlp:~# su - FD3S01\\Serverworld Creating directory '/home/serverworld@srv.world'. serverworld@srv.world@dlp:~$ # 遷移できた
|
[3] | AD ユーザーを指定する際に、ドメイン名を省略したい場合は、以下のように設定します。 |
root@dlp:~#
vi /etc/sssd/sssd.conf # 16行目:変更 use_fully_qualified_names = False
root@dlp:~#
root@dlp:~# systemctl restart sssd id Administrator uid=880000500(administrator) gid=880000513(domain users) groups=880000513(domain users),880000572(denied rodc password replication group),880000519(enterprise admins),880000512(domain admins),880000518(schema admins),880000520(group policy creator owners) |
|