FreeIPA/client をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
FreeIPAにLinuxマシンを参加させます.
***下準備 [#jc6095a0]
時計合わせは大事.
#code(nonumber){{
[root@freeipa-client ~]# cat /etc/redhat-release
Rocky Linux release 9.6 (Blue Onyx)
[root@freeipa-client ~]# echo `hostname -i` `hostname -f`...
[root@freeipa-client ~]# echo "server c.sybyl.local iburs...
[root@freeipa-client ~]# systemctl enable chronyd --now
}}
***パッケージインストール [#a806a0d4]
パッケージをインストールします. 使用するコマンドは「dnf i...
#code(nonumber){{
[root@freeipa-client ~]# dnf install ipa-client -y
}}
***参加作業 [#b528e667]
FreeIPAサーバに参加するには「ipa-client-install」を使用し...
#code(nonumber){{
[root@freeipa-client ~]# ipa-client-install --no-ntp
This program will set up IPA client.
Version 4.12.2
Discovery was successful!
Client hostname: freeipa-client.sybyl.local
Realm: SYBYL.LOCAL
DNS Domain: sybyl.local
IPA Server: freeipa.sybyl.local
BaseDN: dc=sybyl,dc=local
Continue to configure the system with these values? [no]:...
Skipping chrony configuration
User authorized to enroll computers: admin ...
Password for admin@SYBYL.LOCAL: ...
Successfully retrieved CA cert
Subject: CN=Certificate Authority,O=SYBYL.LOCAL
Issuer: CN=Certificate Authority,O=SYBYL.LOCAL
Valid From: 2025-09-27 19:27:06+00:00
Valid Until: 2045-09-27 19:27:06+00:00
Enrolled in IPA realm SYBYL.LOCAL
Created /etc/ipa/default.conf
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....
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.d/04-ipa.conf
Configuring sybyl.local as NIS domain.
Configured /etc/krb5.conf for IPA realm SYBYL.LOCAL
Client configuration complete.
The ipa-client-install command was successful
[root@freeipa-client ~]#
}}
***確認 [#x3c72db2]
ipa-client-installの完成後には sssd が動いていて下記のよ...
#code(nonumber){{
[root@freeipa-client ~]# authselect current
Profile ID: sssd
Enabled features:
- with-sudo
[root@freeipa-client ~]#
}}
っでこの段階で既にidとかは拾える &size(10){既に作ってれ...
#code(nonumber){{
[root@freeipa-client ~]# id arcueid
uid=3001(arcueid) gid=2003(em) groups=2003(em)
[root@freeipa-client ~]# getent passwd arcueid
arcueid:*:3001:2003:Arcueid Brunestud:/home/arcueid:/bin/...
[root@freeipa-client ~]#
}}
***FreeIPAサーバにてnfsサービスプリンシパルを作る [#jf925...
freeipa内でkrb5を使ったnfs mountをするにはクライアントに ...
なのでnfs-client向けのnfsサービスプリンシパルをfreeipaサ...
まず管理者チケットを貰います
#code(nonumber){{
[root@freeipa ~]# kinit admin
Password for admin@SYBYL.LOCAL:
[root@freeipa ~]#
}}
freeipa-clientへのサービス記述子がnfsのサービスプリンシパ...
#code(nonumber){{
[root@freeipa ~]# ipa service-add nfs/freeipa-client.syby...
----------------------------------------------------------
Added service "nfs/freeipa-client.sybyl.local@SYBYL.LOCAL"
----------------------------------------------------------
Principal name: nfs/freeipa-client.sybyl.local@SYBYL.LO...
Principal alias: nfs/freeipa-client.sybyl.local@SYBYL.L...
Managed by: freeipa-client.sybyl.local
[root@freeipa ~]#
(確認)
[root@freeipa ~]# ipa service-find freeipa-client.sybyl.l...
-----------------
1 service matched
-----------------
Principal name: nfs/freeipa-client.sybyl.local@SYBYL.LO...
Principal alias: nfs/freeipa-client.sybyl.local@SYBYL.L...
Keytab: False
----------------------------
Number of entries returned 1
----------------------------
[root@freeipa ~]#
}}
***krb5.keytabの更新 [#fb9d1800]
既にFreeIPAに参加しているので 既に /etc/krb5.keytab は持...
#code(nonumber){{
[root@freeipa-client ~]# klist -ke /etc/krb5.keytab
Keytab name: FILE:/etc/krb5.keytab
KVNO Principal
---- ----------------------------------------------------...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-...
[root@freeipa-client ~]# kinit admin
[root@freeipa-client ~]# ipa-getkeytab -s freeipa.sybyl.l...
Keytab successfully retrieved and stored in: /etc/krb5.ke...
[root@freeipa-client ~]# klist -ke /etc/krb5.keytab
Keytab name: FILE:/etc/krb5.keytab
KVNO Principal
---- ----------------------------------------------------...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-...
1 nfs/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-c...
1 nfs/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-c...
1 nfs/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-c...
1 nfs/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-c...
[root@freeipa-client ~]#
}}
次に「ipa-client-automount」を実行する
#code(nonumber){{
[root@freeipa-client ~]# ipa-client-automount
Searching for IPA server...
IPA server: DNS discovery
Location: default
Continue to configure the system with these values? [no]:...
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
[root@freeipa-client ~]#
(確認)
[root@freeipa-client ~]# ls -l /apps /home
[root@freeipa-client ~]# df -Th /home /apps
Filesystem Type Size Used Avail Use% Mounted on
freeipa-nfs:/home nfs4 32G 261M 32G 1% /home
freeipa-nfs:/apps nfs4 32G 261M 32G 1% /apps
[root@freeipa-client ~]#
[root@freeipa-client ~]# mount |grep -e apps -e home
auto.direct on /home type autofs (rw,relatime,fd=6,pgrp=3...
freeipa-nfs:/home on /home type nfs4 (rw,relatime,vers=4....
auto.direct on /apps type autofs (rw,relatime,fd=6,pgrp=3...
freeipa-nfs:/apps on /apps type nfs4 (rw,relatime,vers=4....
[root@freeipa-client ~]#
[root@freeipa-client ~]# setsebool -P use_nfs_home_dirs 1...
}}
「sec=krb5」が入っているのでkerberosでnfsが行っているみた...
「sec=krb5i」で繋ぎたければ「ipa automountkey-mod default...
&size(10){sec欄がkrb5iならチェックサム付き、krb5pならnfs...
***めも [#o93948c2]
設定を変更するには一度「ipa-client-install --uninstall」...
ホームディレクトリを設けるなら「ipa-client-install」のオ...
ですがホームディレクトリ先をnfsで受けるなら、nfsサーバを...
「ipa-client-install」の「--mkhomedir」はローカルにホーム...
#code(nonumber){{
[root@freeipa-client ~]# ls -l /home
total 0
[root@freeipa-client ~]# su - arcueid
Creating home directory for arcueid.
[arcueid@freeipa-client ~]$ pwd
/home/arcueid
[arcueid@freeipa-client ~]$
}}
クライアントを設定するとおおもとのFreeIPAサーバにも設定さ...
#code(nonumber){{
[root@freeipa ~]# ipa host-show freeipa-client
Host name: freeipa-client.sybyl.local
Platform: x86_64
Operating system: 5.14.0-570.42.2.el9_6.x86_64
Principal name: host/freeipa-client.sybyl.local@SYBYL.L...
Principal alias: host/freeipa-client.sybyl.local@SYBYL....
SSH public key fingerprint: (略
Password: False
Keytab: True
Managed by: freeipa-client.sybyl.local
[root@freeipa ~]#
}}
***ログイン [#s890d63e]
freeipaで作成したアカウントでログインを試みると初期パスワ...
その後すぐさま、パスワードの変更が求められ、パスワードが...
もちろん次回以降は変更したパスワードでログインになるだけ...
#code(nonumber){{
[llya@c ~]$ ssh -l arcueid freeipa-client
Password: <--- 初期...
Password expired. Change your password now.
Current Password:
New password:
Retype new password:
Last login: Sun Sep 28 08:47:12 2025
[illya@freeipa-client ~]$
}}
***メモ(ログイン、ログアウトが遅くなる) [#h981b123]
freeipaで作られたユーザのログイン、ログアウトにタイムラグ...
これは &color(magenta){sec=krb5}; を使った時のお話です。...
いろいろ調査して試してみたけど、早くなったり遅くなったり...
&color(magenta){sec=krb5};による利点は、mount先へのアクセ...
以外にnfsはセキュアではない.
ですが、ログインが遅いとかログアウトが遅いのは問題で、現...
#code(nonumber){{
[root@freeipa ~]# ipa automountkey-mod default auto.direc...
}}
と&color(orangered){sec=sys};に変更して
freeipa-nfs にて sys でのmountを許可するように変更します
#code(nonumber){{
[root@freeipa-nfs ~]# vi /etc/exports
/nfs 192.168.0.0/255.255.255.0(rw,sync,fsid=0)
/nfs/home 192.168.0.0/255.255.255.0(rw,sync,nohide)
/nfs/apps 192.168.0.0/255.255.255.0(rw,sync,nohide)
[root@freeipa-nfs ~]# systemctl restart nfs-server
}}
として &color(orangered){sec=sys}; によるautofsを利用し...
&color(orangered){sec=sys};でセキュアを保つには...802.1X...
samba-adならkrb5通信にこのようなログイン・ログアウトが遅...
今後も管理対象区分かな.
終了行:
FreeIPAにLinuxマシンを参加させます.
***下準備 [#jc6095a0]
時計合わせは大事.
#code(nonumber){{
[root@freeipa-client ~]# cat /etc/redhat-release
Rocky Linux release 9.6 (Blue Onyx)
[root@freeipa-client ~]# echo `hostname -i` `hostname -f`...
[root@freeipa-client ~]# echo "server c.sybyl.local iburs...
[root@freeipa-client ~]# systemctl enable chronyd --now
}}
***パッケージインストール [#a806a0d4]
パッケージをインストールします. 使用するコマンドは「dnf i...
#code(nonumber){{
[root@freeipa-client ~]# dnf install ipa-client -y
}}
***参加作業 [#b528e667]
FreeIPAサーバに参加するには「ipa-client-install」を使用し...
#code(nonumber){{
[root@freeipa-client ~]# ipa-client-install --no-ntp
This program will set up IPA client.
Version 4.12.2
Discovery was successful!
Client hostname: freeipa-client.sybyl.local
Realm: SYBYL.LOCAL
DNS Domain: sybyl.local
IPA Server: freeipa.sybyl.local
BaseDN: dc=sybyl,dc=local
Continue to configure the system with these values? [no]:...
Skipping chrony configuration
User authorized to enroll computers: admin ...
Password for admin@SYBYL.LOCAL: ...
Successfully retrieved CA cert
Subject: CN=Certificate Authority,O=SYBYL.LOCAL
Issuer: CN=Certificate Authority,O=SYBYL.LOCAL
Valid From: 2025-09-27 19:27:06+00:00
Valid Until: 2045-09-27 19:27:06+00:00
Enrolled in IPA realm SYBYL.LOCAL
Created /etc/ipa/default.conf
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....
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.d/04-ipa.conf
Configuring sybyl.local as NIS domain.
Configured /etc/krb5.conf for IPA realm SYBYL.LOCAL
Client configuration complete.
The ipa-client-install command was successful
[root@freeipa-client ~]#
}}
***確認 [#x3c72db2]
ipa-client-installの完成後には sssd が動いていて下記のよ...
#code(nonumber){{
[root@freeipa-client ~]# authselect current
Profile ID: sssd
Enabled features:
- with-sudo
[root@freeipa-client ~]#
}}
っでこの段階で既にidとかは拾える &size(10){既に作ってれ...
#code(nonumber){{
[root@freeipa-client ~]# id arcueid
uid=3001(arcueid) gid=2003(em) groups=2003(em)
[root@freeipa-client ~]# getent passwd arcueid
arcueid:*:3001:2003:Arcueid Brunestud:/home/arcueid:/bin/...
[root@freeipa-client ~]#
}}
***FreeIPAサーバにてnfsサービスプリンシパルを作る [#jf925...
freeipa内でkrb5を使ったnfs mountをするにはクライアントに ...
なのでnfs-client向けのnfsサービスプリンシパルをfreeipaサ...
まず管理者チケットを貰います
#code(nonumber){{
[root@freeipa ~]# kinit admin
Password for admin@SYBYL.LOCAL:
[root@freeipa ~]#
}}
freeipa-clientへのサービス記述子がnfsのサービスプリンシパ...
#code(nonumber){{
[root@freeipa ~]# ipa service-add nfs/freeipa-client.syby...
----------------------------------------------------------
Added service "nfs/freeipa-client.sybyl.local@SYBYL.LOCAL"
----------------------------------------------------------
Principal name: nfs/freeipa-client.sybyl.local@SYBYL.LO...
Principal alias: nfs/freeipa-client.sybyl.local@SYBYL.L...
Managed by: freeipa-client.sybyl.local
[root@freeipa ~]#
(確認)
[root@freeipa ~]# ipa service-find freeipa-client.sybyl.l...
-----------------
1 service matched
-----------------
Principal name: nfs/freeipa-client.sybyl.local@SYBYL.LO...
Principal alias: nfs/freeipa-client.sybyl.local@SYBYL.L...
Keytab: False
----------------------------
Number of entries returned 1
----------------------------
[root@freeipa ~]#
}}
***krb5.keytabの更新 [#fb9d1800]
既にFreeIPAに参加しているので 既に /etc/krb5.keytab は持...
#code(nonumber){{
[root@freeipa-client ~]# klist -ke /etc/krb5.keytab
Keytab name: FILE:/etc/krb5.keytab
KVNO Principal
---- ----------------------------------------------------...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-...
[root@freeipa-client ~]# kinit admin
[root@freeipa-client ~]# ipa-getkeytab -s freeipa.sybyl.l...
Keytab successfully retrieved and stored in: /etc/krb5.ke...
[root@freeipa-client ~]# klist -ke /etc/krb5.keytab
Keytab name: FILE:/etc/krb5.keytab
KVNO Principal
---- ----------------------------------------------------...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-...
1 host/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-...
1 nfs/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-c...
1 nfs/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-c...
1 nfs/freeipa-client.sybyl.local@SYBYL.LOCAL (aes256-c...
1 nfs/freeipa-client.sybyl.local@SYBYL.LOCAL (aes128-c...
[root@freeipa-client ~]#
}}
次に「ipa-client-automount」を実行する
#code(nonumber){{
[root@freeipa-client ~]# ipa-client-automount
Searching for IPA server...
IPA server: DNS discovery
Location: default
Continue to configure the system with these values? [no]:...
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
[root@freeipa-client ~]#
(確認)
[root@freeipa-client ~]# ls -l /apps /home
[root@freeipa-client ~]# df -Th /home /apps
Filesystem Type Size Used Avail Use% Mounted on
freeipa-nfs:/home nfs4 32G 261M 32G 1% /home
freeipa-nfs:/apps nfs4 32G 261M 32G 1% /apps
[root@freeipa-client ~]#
[root@freeipa-client ~]# mount |grep -e apps -e home
auto.direct on /home type autofs (rw,relatime,fd=6,pgrp=3...
freeipa-nfs:/home on /home type nfs4 (rw,relatime,vers=4....
auto.direct on /apps type autofs (rw,relatime,fd=6,pgrp=3...
freeipa-nfs:/apps on /apps type nfs4 (rw,relatime,vers=4....
[root@freeipa-client ~]#
[root@freeipa-client ~]# setsebool -P use_nfs_home_dirs 1...
}}
「sec=krb5」が入っているのでkerberosでnfsが行っているみた...
「sec=krb5i」で繋ぎたければ「ipa automountkey-mod default...
&size(10){sec欄がkrb5iならチェックサム付き、krb5pならnfs...
***めも [#o93948c2]
設定を変更するには一度「ipa-client-install --uninstall」...
ホームディレクトリを設けるなら「ipa-client-install」のオ...
ですがホームディレクトリ先をnfsで受けるなら、nfsサーバを...
「ipa-client-install」の「--mkhomedir」はローカルにホーム...
#code(nonumber){{
[root@freeipa-client ~]# ls -l /home
total 0
[root@freeipa-client ~]# su - arcueid
Creating home directory for arcueid.
[arcueid@freeipa-client ~]$ pwd
/home/arcueid
[arcueid@freeipa-client ~]$
}}
クライアントを設定するとおおもとのFreeIPAサーバにも設定さ...
#code(nonumber){{
[root@freeipa ~]# ipa host-show freeipa-client
Host name: freeipa-client.sybyl.local
Platform: x86_64
Operating system: 5.14.0-570.42.2.el9_6.x86_64
Principal name: host/freeipa-client.sybyl.local@SYBYL.L...
Principal alias: host/freeipa-client.sybyl.local@SYBYL....
SSH public key fingerprint: (略
Password: False
Keytab: True
Managed by: freeipa-client.sybyl.local
[root@freeipa ~]#
}}
***ログイン [#s890d63e]
freeipaで作成したアカウントでログインを試みると初期パスワ...
その後すぐさま、パスワードの変更が求められ、パスワードが...
もちろん次回以降は変更したパスワードでログインになるだけ...
#code(nonumber){{
[llya@c ~]$ ssh -l arcueid freeipa-client
Password: <--- 初期...
Password expired. Change your password now.
Current Password:
New password:
Retype new password:
Last login: Sun Sep 28 08:47:12 2025
[illya@freeipa-client ~]$
}}
***メモ(ログイン、ログアウトが遅くなる) [#h981b123]
freeipaで作られたユーザのログイン、ログアウトにタイムラグ...
これは &color(magenta){sec=krb5}; を使った時のお話です。...
いろいろ調査して試してみたけど、早くなったり遅くなったり...
&color(magenta){sec=krb5};による利点は、mount先へのアクセ...
以外にnfsはセキュアではない.
ですが、ログインが遅いとかログアウトが遅いのは問題で、現...
#code(nonumber){{
[root@freeipa ~]# ipa automountkey-mod default auto.direc...
}}
と&color(orangered){sec=sys};に変更して
freeipa-nfs にて sys でのmountを許可するように変更します
#code(nonumber){{
[root@freeipa-nfs ~]# vi /etc/exports
/nfs 192.168.0.0/255.255.255.0(rw,sync,fsid=0)
/nfs/home 192.168.0.0/255.255.255.0(rw,sync,nohide)
/nfs/apps 192.168.0.0/255.255.255.0(rw,sync,nohide)
[root@freeipa-nfs ~]# systemctl restart nfs-server
}}
として &color(orangered){sec=sys}; によるautofsを利用し...
&color(orangered){sec=sys};でセキュアを保つには...802.1X...
samba-adならkrb5通信にこのようなログイン・ログアウトが遅...
今後も管理対象区分かな.
ページ名:
1