IDM構築手順メモ
| 登録日 | :2026/09/21 18:37 |
|---|---|
| カテゴリ | :Linux |
Linux 8.xでのIDMインストール手順について
サーバ側の手順
ホスト名設定
sudo hostnamectl set-hostname ipa.example.local
/etc/hostsにエントリーも追加しておく
192.168.1.10 ipa.example.local ipa
タイムゾーン/NTP同期を先に整えておく(Kerberosは時刻ズレに弱いため)
SELinux: enforcingのままで基本問題ないが、トラブル時は一時的にpermissiveで切り分け可
- ファイアウォール解放(無効化でもいい)
sudo firewall-cmd --add-service={freeipa-ldap,freeipa-ldaps,dns,ntp,http,https,kerberos} --permanent
sudo firewall-cmd --reload
- パッケージインストール
パッケージインストールRockyLinuxシステムでは、FreeIPA関連のパッケージはすべてidm:DL1モジュールで提供されており、FreeIPAパッケージをインストールするにはidm:DL1モジュールを有効化する必要があります
sudo dnf module enable idm:DL1
sudo dnf install ipa-server ipa-server-dns -y
- インストーラの実行
sudo ipa-server-install --setup-dns --allow-zone-overlap
インストール実行ログ
[root@ipa ~]# sudo ls -la /etc/ipa/custodia/
合計 0
drwx------. 2 root root 6 3月 4 2026 .
drwxr-xr-x. 7 root root 104 9月 21 17:59 ..
[root@ipa ~]# sudo ls -la /etc/ipa/
合計 20
drwxr-xr-x. 7 root root 104 9月 21 17:59 .
drwxr-xr-x. 160 root root 12288 9月 21 17:59 ..
drwx------. 2 root root 6 3月 4 2026 custodia
-rw-r--r--. 1 root root 286 9月 21 17:38 default.conf.ipabkp
drwxr-xr-x. 2 root root 6 3月 4 2026 dnssec
drwxr-xr-x. 2 root root 53 9月 21 17:59 html
drwxr-xr-x. 2 root root 27 9月 21 17:59 kdcproxy
drwxr-xr-x. 2 root root 6 3月 4 2026 nssdb
[root@ipa ~]# sudo ls -la /var/lib/ipa/
合計 4
drwxr-xr-x. 10 root root 129 9月 21 17:59 .
drwxr-xr-x. 73 root root 4096 9月 21 17:59 ..
drwx------. 2 root root 6 3月 4 2026 backup
drwxr-xr-x. 2 root root 6 3月 4 2026 certs
drwx------. 2 root root 6 3月 4 2026 gssproxy
drwx------. 2 root root 6 3月 4 2026 passwds
drwxr-xr-x. 2 root root 6 3月 4 2026 pki-ca
drwx------. 2 root root 6 3月 4 2026 private
drwx--x--x. 2 root root 6 3月 4 2026 sysrestore
drwx------. 2 root root 6 3月 4 2026 sysupgrade
[root@ipa ~]# sudo ipa-server-install --setup-dns --allow-zone-overlap
The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.
Version 4.9.13
This includes:
* Configure a stand-alone CA (dogtag) for certificate management
* Configure the NTP client (chronyd)
* Create and configure an instance of Directory Server
* Create and configure a Kerberos Key Distribution Center (KDC)
* Configure Apache (httpd)
* Configure DNS (bind)
* Configure SID generation
* Configure the KDC to enable PKINIT
To accept the default shown in brackets, press the Enter key.
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
Server host name [ipa.example.local]:
Warning: skipping DNS resolution of host ipa.example.local
The domain name has been determined based on the host name.
Please confirm the domain name [example.local]:
The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.
Please provide a realm name [EXAMPLE.LOCAL]:
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 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 password:
Password (confirm):
Checking DNS domain example.local., please wait ...
Do you want to configure DNS forwarders? [yes]:
Following DNS servers are configured in /etc/resolv.conf: 192.168.11.1
Do you want to configure these servers as DNS forwarders? [yes]:
All detected DNS servers were added. You can enter additional addresses now:
Enter an IP address for a DNS forwarder, or press Enter to skip:
DNS forwarders: 192.168.11.1
Checking DNS forwarders, please wait ...
Do you want to search for missing reverse zones? [yes]:
Do you want to create reverse zone for IP 192.168.56.104 [yes]:
Please specify the reverse zone name [56.168.192.in-addr.arpa.]:
Using reverse zone(s) 56.168.192.in-addr.arpa.
Trust is configured but no NetBIOS domain name found, setting it now.
Enter the NetBIOS name for the IPA domain.
Only up to 15 uppercase ASCII letters, digits and dashes are allowed.
Example: EXAMPLE.
NetBIOS domain name [EXAMPLE]:
Do you want to configure chrony with NTP server or pool address? [no]:
The IPA Master Server will be configured with:
Hostname: ipa.example.local
IP address(es): 192.168.56.104
Domain name: example.local
Realm name: EXAMPLE.LOCAL
The CA will be configured with:
Subject DN: CN=Certificate Authority,O=EXAMPLE.LOCAL
Subject base: O=EXAMPLE.LOCAL
Chaining: self-signed
BIND DNS server will be configured to serve IPA domain with:
Forwarders: 192.168.11.1
Forward policy: only
Reverse zone(s): 56.168.192.in-addr.arpa.
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.
Disabled p11-kit-proxy
Synchronizing time
No SRV records of NTP servers found and no NTP server or pool address was provided.
Using default chrony configuration.
Attempting to sync time with chronyc.
Time synchronization was successful.
Configuring directory server (dirsrv). Estimated time: 30 seconds
[1/43]: creating directory server instance
Validate installation settings ...
Create file system structures ...
Perform SELinux labeling ...
Create database backend: dc=example,dc=local ...
Perform post-installation tasks ...
[2/43]: tune ldbm plugin
[3/43]: adding default schema
[4/43]: enabling memberof plugin
[5/43]: enabling winsync plugin
[6/43]: configure password logging
[7/43]: configuring replication version plugin
[8/43]: enabling IPA enrollment plugin
[9/43]: configuring uniqueness plugin
[10/43]: configuring uuid plugin
[11/43]: configuring modrdn plugin
[12/43]: configuring DNS plugin
[13/43]: enabling entryUSN plugin
[14/43]: configuring lockout plugin
[15/43]: configuring graceperiod plugin
[16/43]: configuring topology plugin
[17/43]: creating indices
[18/43]: enabling referential integrity plugin
[19/43]: configuring certmap.conf
[20/43]: configure new location for managed entries
[21/43]: configure dirsrv ccache and keytab
[22/43]: enabling SASL mapping fallback
[23/43]: restarting directory server
[24/43]: adding sasl mappings to the directory
[25/43]: adding default layout
[26/43]: adding delegation layout
[27/43]: creating container for managed entries
[28/43]: configuring user private groups
[29/43]: configuring netgroups from hostgroups
[30/43]: creating default Sudo bind user
[31/43]: creating default Auto Member layout
[32/43]: adding range check plugin
[33/43]: creating default HBAC rule allow_all
[34/43]: adding entries for topology management
[35/43]: initializing group membership
[36/43]: adding master entry
[37/43]: initializing domain level
[38/43]: configuring Posix uid/gid generation
[39/43]: adding replication acis
[40/43]: activating sidgen plugin
[41/43]: activating extdom plugin
[42/43]: configuring directory to start on boot
[43/43]: restarting directory server
Done configuring directory server (dirsrv).
Configuring Kerberos KDC (krb5kdc)
[1/10]: adding kerberos container to the directory
[2/10]: configuring KDC
[3/10]: initialize kerberos container
[4/10]: adding default ACIs
[5/10]: creating a keytab for the directory
[6/10]: creating a keytab for the machine
[7/10]: adding the password extension to the directory
[8/10]: creating anonymous principal
[9/10]: starting the KDC
[10/10]: configuring KDC to start on boot
Done configuring Kerberos KDC (krb5kdc).
Configuring kadmin
[1/2]: starting kadmin
[2/2]: configuring kadmin to start on boot
Done configuring kadmin.
Configuring ipa-custodia
[1/5]: Making sure custodia container exists
[2/5]: Generating ipa-custodia config file
[3/5]: Generating ipa-custodia keys
[4/5]: starting ipa-custodia
[5/5]: configuring ipa-custodia to start on boot
Done configuring ipa-custodia.
Configuring certificate server (pki-tomcatd). Estimated time: 3 minutes
[1/29]: configuring certificate server instance
[2/29]: stopping certificate server instance to update CS.cfg
[3/29]: backing up CS.cfg
[4/29]: Add ipa-pki-wait-running
[5/29]: secure AJP connector
[6/29]: reindex attributes
[7/29]: exporting Dogtag certificate store pin
[8/29]: disabling nonces
[9/29]: set up CRL publishing
[10/29]: enable PKIX certificate path discovery and validation
[11/29]: authorizing RA to modify profiles
[12/29]: authorizing RA to manage lightweight CAs
[13/29]: Ensure lightweight CAs container exists
[14/29]: Ensuring backward compatibility
[15/29]: starting certificate server instance
[16/29]: configure certmonger for renewals
[17/29]: requesting RA certificate from CA
[18/29]: publishing the CA certificate
[19/29]: adding RA agent as a trusted user
[20/29]: configure certificate renewals
[21/29]: Configure HTTP to proxy connections
[22/29]: updating IPA configuration
[23/29]: enabling CA instance
[24/29]: importing IPA certificate profiles
[25/29]: migrating certificate profiles to LDAP
[26/29]: adding default CA ACL
[27/29]: adding 'ipa' CA entry
[28/29]: configuring certmonger renewal for lightweight CAs
[29/29]: deploying ACME service
Done configuring certificate server (pki-tomcatd).
Configuring directory server (dirsrv)
[1/3]: configuring TLS for DS instance
[2/3]: adding CA certificate entry
[3/3]: restarting directory server
Done configuring directory server (dirsrv).
Configuring ipa-otpd
[1/2]: starting ipa-otpd
[2/2]: configuring ipa-otpd to start on boot
Done configuring ipa-otpd.
Configuring the web interface (httpd)
[1/22]: stopping httpd
[2/22]: backing up ssl.conf
[3/22]: disabling nss.conf
[4/22]: configuring mod_ssl certificate paths
[5/22]: setting mod_ssl protocol list
[6/22]: configuring mod_ssl log directory
[7/22]: disabling mod_ssl OCSP
[8/22]: adding URL rewriting rules
[9/22]: configuring httpd
Nothing to do for configure_httpd_wsgi_conf
[10/22]: setting up httpd keytab
[11/22]: configuring Gssproxy
[12/22]: setting up ssl
[13/22]: configure certmonger for renewals
[14/22]: publish CA cert
[15/22]: clean up any existing httpd ccaches
[16/22]: enable ccache sweep
[17/22]: configuring SELinux for httpd
[18/22]: create KDC proxy config
[19/22]: enable KDC proxy
[20/22]: starting httpd
[21/22]: configuring httpd to start on boot
[22/22]: enabling oddjobd
Done configuring the web interface (httpd).
Configuring Kerberos KDC (krb5kdc)
[1/1]: installing X509 Certificate for PKINIT
Done configuring Kerberos KDC (krb5kdc).
Applying LDAP updates
Upgrading IPA:. Estimated time: 1 minute 30 seconds
[1/10]: stopping directory server
[2/10]: saving configuration
[3/10]: disabling listeners
[4/10]: enabling DS global lock
[5/10]: disabling Schema Compat
[6/10]: starting directory server
[7/10]: upgrading server
[8/10]: stopping directory server
[9/10]: restoring configuration
[10/10]: starting directory server
Done.
Restarting the KDC
dnssec-validation yes
Configuring DNS (named)
[1/12]: generating rndc key file
[2/12]: adding DNS container
[3/12]: setting up our zone
[4/12]: setting up reverse zone
[5/12]: setting up our own record
[6/12]: setting up records for other masters
[7/12]: adding NS record to the zones
[8/12]: setting up kerberos principal
[9/12]: setting up named.conf
created new /etc/named.conf
created named user config '/etc/named/ipa-ext.conf'
created named user config '/etc/named/ipa-options-ext.conf'
created named user config '/etc/named/ipa-logging-ext.conf'
[10/12]: setting up server configuration
[11/12]: configuring named to start on boot
[12/12]: changing resolv.conf to point to ourselves
Done configuring DNS (named).
Restarting the web server to pick up resolv.conf changes
Configuring DNS key synchronization service (ipa-dnskeysyncd)
[1/7]: checking status
[2/7]: setting up bind-dyndb-ldap working directory
[3/7]: setting up kerberos principal
[4/7]: setting up SoftHSM
[5/7]: adding DNSSEC containers
[6/7]: creating replica keys
[7/7]: configuring ipa-dnskeysyncd to start on boot
Done configuring DNS key synchronization service (ipa-dnskeysyncd).
Restarting ipa-dnskeysyncd
Restarting named
Updating DNS system records
Configuring SID generation
[1/8]: creating samba domain object
[2/8]: adding admin(group) SIDs
[3/8]: adding RID bases
[4/8]: updating Kerberos config
'dns_lookup_kdc' already set to 'true', nothing to do.
[5/8]: activating sidgen task
[6/8]: restarting Directory Server to take MS PAC and LDAP plugins changes into account
[7/8]: adding fallback group
[8/8]: adding SIDs to existing users and groups
This step may take considerable amount of time, please wait..
Done.
Restarting the KDC
Configuring client side components
This program will set up IPA client.
Version 4.9.13
Using existing certificate '/etc/ipa/ca.crt'.
Client hostname: ipa.example.local
Realm: EXAMPLE.LOCAL
DNS Domain: example.local
IPA Server: ipa.example.local
BaseDN: dc=example,dc=local
Configured /etc/sssd/sssd.conf
Systemwide CA database updated.
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Configuring example.local as NIS domain.
Client configuration complete.
The ipa-client-install command was successful
==============================================================================
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
The ipa-server-install command was successful
[root@ipa ~]#
- Kerberosチケット取得で疎通確認
動作確認
kinit admin
ipa user-find admin
[root@ipa ~]# kinit admin
Password for admin@EXAMPLE.LOCAL:
[root@ipa ~]# ipa user-find admin
--------------
1 user matched
--------------
User login: admin
Last name: Administrator
Home directory: /home/admin
Login shell: /bin/bash
Principal name: admin@EXAMPLE.LOCAL
Principal alias: admin@EXAMPLE.LOCAL, root@EXAMPLE.LOCAL
UID: 1533000000
GID: 1533000000
Account disabled: False
----------------------------
Number of entries returned 1
----------------------------
[root@ipa ~]#
CA証明書のバックアップ
sudo cp /root/cacert.p12 /root/cacert.p12.backup
サービス状態確認
sudo ipactl status
コマンド実行時の応答
[root@ipa ~]# sudo cp /root/cacert.p12 /root/cacert.p12.backup
[root@ipa ~]#
[root@ipa ~]# sudo ipactl status
Directory Service: RUNNING
krb5kdc Service: RUNNING
kadmin Service: RUNNING
named Service: RUNNING
httpd Service: RUNNING
ipa-custodia Service: RUNNING
pki-tomcatd Service: RUNNING
ipa-otpd Service: RUNNING
ipa-dnskeysyncd Service: RUNNING
ipa: INFO: The ipactl command was successful
[root@ipa ~]#
(補足:トラブルシューティング、再インストール)
sudo ipa-server-install --uninstall -U
sudo dnf remove ipa-server ipa-server-dns ipa-server-common ipa-common -y
sudo dnf install ipa-server ipa-server-dns -y
sudo ls -la /etc/ipa/custodia/
sudo ipa-server-install --setup-dns --allow-zone-overlap
次にパッケージレベルでファイル構造を復元
手動削除で壊れた/etc/ipa/custodia/などのディレクトリ構造をパッケージ再構築で直します
sudo dnf remove ipa-server ipa-server-dns ipa-server-common ipa-common -y
sudo dnf install ipa-server ipa-server-dns -y
sudo ls -la /etc/ipa/custodia/
sudo ls -la /etc/ipa/
sudo ls -la /var/lib/ipa/
再実行
sudo ipa-server-install --setup-dns --allow-zone-overlap
クライアント側の設定
- ホスト名とhosts設定
sudo hostnamectl set-hostname client.example.local
echo "192.168.56.104 ipa.example.local ipa" | sudo tee -a /etc/hosts
(クライアント自身のIPも同様に/etc/hostsもしくはDNS側で解決できるようにしておいてください)
- パッケージインストール
sudo dnf install ipa-client -y
- クライアント参加
sudo ipa-client-install --domain=example.local --server=ipa.example.local --mkhomedir
実行時のログ
[root@nis1client-dns ~]# sudo ipa-client-install --domain=example.local --server=ipa.example.local --mkhomedir
This program will set up IPA client.
Version 4.9.13
Autodiscovery of servers for failover cannot work with this configuration.
If you proceed with the installation, services will be configured to always access the discovered server for all operations and will not fail over to other servers in case of failure.
Proceed with fixed values and no DNS discovery? [no]: yes
Do you want to configure chrony with NTP server or pool address? [no]:
Client hostname: client.example.local
Realm: EXAMPLE.LOCAL
DNS Domain: example.local
IPA Server: ipa.example.local
BaseDN: dc=example,dc=local
Continue to configure the system with these values? [no]: yes
Synchronizing time
No SRV records of NTP servers found and no NTP server or pool address was provided.
Using default chrony configuration.
Attempting to sync time with chronyc.
Time synchronization was successful.
User authorized to enroll computers: admin
Password for admin@EXAMPLE.LOCAL:
Successfully retrieved CA cert
Subject: CN=Certificate Authority,O=EXAMPLE.LOCAL
Issuer: CN=Certificate Authority,O=EXAMPLE.LOCAL
Valid From: 2026-09-21 09:05:54
Valid Until: 2046-09-21 09:05:54
Enrolled in IPA realm EXAMPLE.LOCAL
Created /etc/ipa/default.conf
Configured /etc/sssd/sssd.conf
Systemwide CA database updated.
Hostname (client.example.local) does not have A/AAAA record.
Failed to update DNS records.
Missing A/AAAA record(s) for host client.example.local: 192.168.56.103.
Missing reverse record(s) for address(es): 192.168.56.103.
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Could not update DNS SSHFP records.
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Configuring example.local as NIS domain.
Configured /etc/krb5.conf for IPA realm EXAMPLE.LOCAL
Client configuration complete.
The ipa-client-install command was successful
[root@nis1client-dns ~]#
動作確認
kinit admin
id admin
getent passwd admin
実行ログ
[root@nis1client-dns ~]# kinit admin
Password for admin@EXAMPLE.LOCAL:
[root@nis1client-dns ~]# id admin
uid=1533000000(admin) gid=1533000000(admins) groups=1533000000(admins)
[root@nis1client-dns ~]# getent passwd admin
admin:*:1533000000:1533000000:Administrator:/home/admin:/bin/bash
[root@nis1client-dns ~]#
実際にIdMユーザでログインテスト
- サーバ側
ipa user-add testuser --first=Test --last=User --password
*パスワードはクライアントユーザのパスワードを設定する
[root@ipa ~]# ipa user-add testuser --first=Test --last=User --password
Password:
確認のため再び Password を入力してください:
---------------------
Added user "testuser"
---------------------
User login: testuser
First name: Test
Last name: User
Full name: Test User
Display name: Test User
Initials: TU
Home directory: /home/testuser
GECOS: Test User
Login shell: /bin/sh
Principal name: testuser@EXAMPLE.LOCAL
Principal alias: testuser@EXAMPLE.LOCAL
User password expiration: 20260921232421Z
Email address: testuser@example.local
UID: 1533000003
GID: 1533000003
Password: True
Member of groups: ipausers
Kerberos keys available: True
[root@ipa ~]#
- クライアント側
su - testuser
[root@client ~]# su - testuser
Creating home directory for testuser.
[testuser@client ~]$