Ubuntu 18.04
Sponsored Link

FreeIPA : サーバーの設定
2018/11/27
 
各サーバー間でユーザーのアカウント情報を共有できるように FreeIPA サーバーを構築します。
[1] FreeIPA をインストールします。
root@dlp:~#
apt -y install freeipa-server freeipa-server-dns
# レルム名を指定
 +------------------+ 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:                                         |
 |                                                                           |
 | IPA.SRV.WORLD____________________________________________________________ |
 |                                                                           |
 |                                  <Ok>                                     |
 |                                                                           |
 +---------------------------------------------------------------------------+

# FreeIPAサーバーのホスト名を指定
  +-----------------+ Configuring Kerberos Authentication +-----------------+
  | Enter the hostnames of Kerberos servers in the IPA.SRV.WORLD Kerberos   |
  | realm separated by spaces.                                              |
  |                                                                         |
  | Kerberos servers for your realm:                                        |
  |                                                                         |
  | dlp.ipa.srv.world______________________________________________________ |
  |                                                                         |
  |                                 <Ok>                                    |
  |                                                                         |
  +-------------------------------------------------------------------------+

# FreeIPAサーバーのホスト名を指定
 +------------------+ Configuring Kerberos Authentication +------------------+
 | Enter the hostname of the administrative (password changing) server for   |
 | the IPA.SRV.WORLD Kerberos realm.                                         |
 |                                                                           |
 | Administrative server for your Kerberos realm:                            |
 |                                                                           |
 | dlp.ipa.srv.world________________________________________________________ |
 |                                                                           |
 |                                  <Ok>                                     |
 |                                                                           |
 +---------------------------------------------------------------------------+
[2] FreeIPA サーバーをセットアップします。当例では FreeIPA サーバー上には同時に内蔵 DNS もセットアップします。
# 自身のホスト名を hosts に登録

root@dlp:~#
echo '10.0.0.30 dlp.ipa.srv.world dlp' >> /etc/hosts
# KDC DB 初期化

root@dlp:~#
kdb5_util create -s -r IPA.SRV.WORLD

Loading random data
Initializing database '/var/lib/krb5kdc/principal' for realm 'IPA.SRV.WORLD',
master key name 'K/M@IPA.SRV.WORLD'
# 任意の DB パスワードを設定
You will be prompted for the database Master Password.
It is important that you NOT FORGET this password.
Enter KDC database master key:
Re-enter KDC database master key to verify:

root@dlp:~#
ipa-server-install --setup-dns

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the FreeIPA Server.

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure DNS (bind)
  * Configure the KDC to enable PKINIT

To accept the default shown in brackets, press the Enter key.

WARNING: conflicting time&date synchronization service 'chronyd' will be disabled
in favor of ntpd

Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: master.example.com.

# ホスト名を確認して Enter
Server host name [dlp.ipa.srv.world]:

Warning: skipping DNS resolution of host dlp.ipa.srv.world
The domain name has been determined based on the host name.

# ドメイン名を確認して Enter
Please confirm the domain name [ipa.srv.world]:

The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.

# realm 名を確認、または変更して Enter
Please provide a realm name [IPA.SRV.WORLD]:
Certain directory server operations require an administrative user.
This user is referred to as the Directory Manager and has full access
to the Directory for system management tasks and will be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.

# Directory Manager のパスワード設定
Directory Manager password:
Password (confirm):

The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.

# IPA admin のパスワード設定
IPA admin password:
Password (confirm):

Checking DNS domain ipa.srv.world., please wait ...
# DNS フォワーダーを設定する場合は yes
Do you want to configure DNS forwarders? [yes]: no
No DNS forwarders configured
# リバースゾーン検索する場合は yes
Do you want to search for missing reverse zones? [yes]: yes

The IPA Master Server will be configured with:
Hostname:       dlp.ipa.srv.world
IP address(es): 10.0.0.30
Domain name:    ipa.srv.world
Realm name:     IPA.SRV.WORLD

The CA will be configured with:
Subject DN:   CN=Certificate Authority,O=IPA.SRV.WORLD
Subject base: O=IPA.SRV.WORLD
Chaining:     self-signed

BIND DNS server will be configured to serve IPA domain with:
Forwarders:       No forwarders
Forward policy:   only
Reverse zone(s):  No reverse zone

# 設定を確認して yes で進む
Continue to configure the system with these values? [no]: yes

The following operations may take some minutes to complete.
Please wait until the prompt is returned.

Configuring NTP daemon (ntpd)
.....
.....
.....
==============================================================================
Setup complete

Next steps:
        1. You must make sure these network ports are open:
                TCP Ports:
                  * 80, 443: HTTP/HTTPS
                  * 389, 636: LDAP/LDAPS
                  * 88, 464: kerberos
                  * 53: bind
                UDP Ports:
                  * 88, 464: kerberos
                  * 53: bind
                  * 123: ntp

        2. You can now obtain a kerberos ticket using the command: 'kinit admin'
           This ticket will allow you to use the IPA tools (e.g., ipa user-add)
           and the web user interface.

Be sure to back up the CA certificates stored in /root/cacert.p12
These files are required to create replicas. The password for these
files is the Directory Manager password

root@dlp:~#
chmod 755 /var/lib/krb5kdc

root@dlp:~#
touch /var/log/kadmind.log /etc/krb5kdc/kadm5.acl

root@dlp:~#
systemctl restart krb5-admin-server

[3] Kerberos チケットを取得しておきます。また、デフォルトシェルを Bash に変更しておきます。
root@dlp:~#
kinit admin

Password for admin@IPA.SRV.WORLD:    
# IPA admin パスワード

root@dlp:~#
klist

Ticket cache: KEYRING:persistent:0:0
Default principal: admin@IPA.SRV.WORLD

Valid starting       Expires              Service principal
11/26/2018 14:06:33  11/27/2018 14:06:31  krbtgt/IPA.SRV.WORLD@IPA.SRV.WORLD

root@dlp:~#
ipa config-mod --defaultshell=/bin/bash

  Maximum username length: 32
  Home directory base: /home
  Default shell: /bin/bash
  Default users group: ipausers
  Default e-mail domain: ipa.srv.world
  Search time limit: 2
  Search size limit: 100
  User search fields: uid,givenname,sn,telephonenumber,ou,title
  Group search fields: cn,description
  Enable migration mode: FALSE
  Certificate Subject base: O=IPA.SRV.WORLD
  Password Expiration Notification (days): 4
  Password plugin features: AllowNThash, KDC:Disable Last Success
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
  Default SELinux user: unconfined_u:s0-s0:c0.c1023
  Default PAC types: MS-PAC, nfs:NONE
  IPA masters: dlp.ipa.srv.world
  IPA CA servers: dlp.ipa.srv.world
  IPA CA renewal master: dlp.ipa.srv.world
  IPA master capable of PKINIT: dlp.ipa.srv.world
関連コンテンツ
 
Tweet