nisがRHEL9から使えなくなった
でも既存のnisシステムがあるので外せない. なら作ってしまおう.

ここではクライアントのypbindを扱います.

gitでypbindのソースが公開されている
https://github.com/thkukuk/ypbind-mt
同じように
libnss
https://github.com/thkukuk/libnss_nis
yp-tools
https://github.com/thkukuk/yp-tools
と用意されている

ypbind-mt

[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.4 (Blue Onyx)
[root@rockylinux9 ~]#
[root@rockylinux9 ~]# git clone https://github.com/thkukuk/ypbind-mt
[root@rockylinux9 ~]# cd ypbind-mt
[root@rockylinux9 ypbind-mt]# git checkout v2.7.2
[root@rockylinux9 ypbind-mt]# cd ..
[root@rockylinux9 ~]#
[root@rockylinux9 ~]# tar --exclude-vcs --transform 's/ypbind-mt/ypbind-mt-2.7.2/' -cvzf ypbind-mt-2.7.2.tar.gz ypbind-mt

rockylinux8のypbindのsrpmを取得してそれをテンプレートに作ってみる. それって単に「rpmbuild --rebuild」でよくね?って思うが最新バージョンにしたかったので

[root@rockylinux9 ~]# curl -O http://dl.rockylinux.org/pub/rocky/8/AppStream/source/tree/Packages/y/ypbind-2.5-2.el8.src.rpm
[root@rockylinux9 ~]# rpm -Uvh ypbind-2.5-2.el8.src.rpm
[root@rockylinux9 ~]# vi rpmbuild/SPECS/ypbind.spec

SPECファイルをちょいと修正

--- rpmbuild/SPECS/ypbind.spec.orig     2021-04-12 18:07:59.000000000 +0900
+++ rpmbuild/SPECS/ypbind.spec  2022-12-24 16:28:51.346494889 +0900
@@ -1,7 +1,7 @@
 Summary: The NIS daemon which binds NIS clients to an NIS domain
 Name: ypbind
 Epoch: 3
-Version: 2.5
+Version: 2.7.2
 Release: 2%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
@@ -58,7 +58,7 @@
 %patch1 -p1 -b .gettextdomain
 %patch2 -p1 -b .helpman
 #%patch3 -p1 -b .systemdso
-%patch4 -b .gettext_version
+#%patch4 -b .gettext_version
 
 autoreconf -fiv

gitから取得したソースを rpmbuild/SOURCES に移してrpmbuildする

[root@rockylinux9 ~]# dnf --enablerepo=devel install dbus-glib-devel libnsl2-devel libtirpc-devel systemd-devel
 
[root@rockylinux9 ~]# cp ypbind-mt-2.7.2.tar.gz rpmbuild/SOURCES/
[root@rockylinux9 ~]# rpmbuild -bb rpmbuild/SPECS/ypbind.spec
[root@rockylinux9 ~]# ls -l rpmbuild/RPMS/x86_64/ypbind-*
-rw-r--r--. 1 root root    53515 Oct 14 00:54 ypbind-2.7.2-2.el9.x86_64.rpm
-rw-r--r--. 1 root root    61045 Oct 14 00:54 ypbind-debuginfo-2.7.2-2.el9.x86_64.rpm
-rw-r--r--. 1 root root    27247 Oct 14 00:54 ypbind-debugsource-2.7.2-2.el9.x86_64.rpm
[root@rockylinux9 ~]#

このypbindを入れれば..になりますが、あとnss_nisとyp-toolsが必要です

nss_nis

同じように

[root@rockylinux9 ~]# git clone https://github.com/thkukuk/libnss_nis
[root@rockylinux9 ~]# cd libnss_nis
[root@rockylinux9 libnss_nis]# git checkout v3.2
[root@rockylinux9 libnss_nis]# cd ..
[root@rockylinux9 ~]# tar --exclude-vcs --transform 's/libnss_nis/libnss_nis-3.2/' -cvzf libnss_nis-3.2.tar.gz libnss_nis
[root@rockylinux9 ~]# curl -O http://dl.rockylinux.org/pub/rocky/8/BaseOS/source/tree/Packages/n/nss_nis-3.0-8.el8.src.rpm
[root@rockylinux9 ~]# rpm -Uvh nss_nis-3.0-8.el8.src.rpm
[root@rockylinux9 ~]# vi rpmbuild/SPECS/nss_nis.spec
--- rpmbuild/SPECS/nss_nis.spec.orig    2021-04-12 14:14:54.000000000 +0900
+++ rpmbuild/SPECS/nss_nis.spec 2023-08-22 20:15:35.529001727 +0900
@@ -1,11 +1,11 @@
 Name:           nss_nis
-Version:        3.0
+Version:        3.2
 Release:        8%{?dist}
 Summary:        Name Service Switch (NSS) module using NIS
 License:        LGPLv2+
 Group:          System Environment/Base
 Url:            https://github.com/thkukuk/libnss_nis
-Source:         https://github.com/thkukuk/libnss_nis/archive/v%{version}.tar.gz
+Source:         https://github.com/thkukuk/libnss_nis/archive/v%{version}.tar.gz#/libnss_nis-%{version}.tar.gz
 
 # https://github.com/systemd/systemd/issues/7074
 Source2:        nss_nis.conf
[root@rockylinux9 ~]# cp libnss_nis-3.2.tar.gz rpmbuild/SOURCES/
[root@rockylinux9 ~]# rpmbuild -bb rpmbuild/SPECS/nss_nis.spec
[root@rockylinux9 ~]# ls -l rpmbuild/RPMS/x86_64/nss_nis-*
-rw-r--r--. 1 root root    41646 Oct 14 00:57 nss_nis-3.2-8.el9.x86_64.rpm
-rw-r--r--. 1 root root    77067 Oct 14 00:57 nss_nis-debuginfo-3.2-8.el9.x86_64.rpm
-rw-r--r--. 1 root root    28048 Oct 14 00:57 nss_nis-debugsource-3.2-8.el9.x86_64.rpm
[root@rockylinux9 ~]#

yp-tools

git由来のversionを調べたら Rokylinux8 と同じ 4.2.3 なので「rpmbuild --rebuild」で済ます

[root@rockylinux9 ~]# curl -O http://dl.rockylinux.org/pub/rocky/8/AppStream/source/tree/Packages/y/yp-tools-4.2.3-2.el8.src.rpm
 
[root@rockylinux9 ~]# rpmbuild --rebuild yp-tools-4.2.3-2.el8.src.rpm
[root@rockylinux9 ~]# ls -l rpmbuild/RPMS/x86_64/yp-tools-*
-rw-r--r--. 1 root root 84056 Oct 14 00:58 rpmbuild/RPMS/x86_64/yp-tools-4.2.3-2.el9.x86_64.rpm
-rw-r--r--. 1 root root 91355 Oct 14 00:58 rpmbuild/RPMS/x86_64/yp-tools-debuginfo-4.2.3-2.el9.x86_64.rpm
-rw-r--r--. 1 root root 26816 Oct 14 00:58 rpmbuild/RPMS/x86_64/yp-tools-debugsource-4.2.3-2.el9.x86_64.rpm
[root@rockylinux9 ~]#

nisをインストール

っでインストール

[root@rockylinux9 ~]# dnf localinstall rpmbuild/RPMS/x86_64/ypbind-2.7.2-2.el9.x86_64.rpm \
                                       rpmbuild/RPMS/x86_64/nss_nis-3.2-8.el9.x86_64.rpm  \
                                       rpmbuild/RPMS/x86_64/yp-tools-4.2.3-2.el9.x86_64.rpm
 
[root@rockylinux9 ~]# vi /etc/yp.conf
domain sybyl server nis
 
[root@rockylinux9 ~]# systemctl enable ypbind --now

これで直接pamやnsswitch.confを修正させてnis対応にすることができるが、RHEL9の行儀に倣えばauthselectを使う事になる
っが、RHEL9で提供される authselect はRHEL9の方針でnisのサポートは当然抜けている.

本来のauthselectはnisもカバー範囲でオリジナルをみると今時点もnisをサポートしている
https://github.com/authselect/authselect

なのでsrpmを取得してnis排除を無効にしてみた

[root@rockylinux9 ~]# curl -O http://dl.rockylinux.org/pub/rocky/9/BaseOS/source/tree/Packages/a/authselect-1.2.6-2.el9.src.rpm
 
[root@rockylinux9 ~]# rpm -Uvh authselect-1.2.6-2.el9.src.rpm
[root@rockylinux9 ~]# vi rpmbuild/SPECS/authselect.spec
--- rpmbuild/SPECS/authselect.spec.orig 2023-11-04 06:54:25.000000000 +0900
+++ rpmbuild/SPECS/authselect.spec      2024-10-14 01:02:07.914130198 +0900
@@ -18,7 +18,6 @@
 Patch0901:  0901-rhel9-remove-mention-of-Fedora-Change-page-in-compat.patch
 Patch0902:  0902-rhel9-remove-ecryptfs-support.patch
 Patch0903:  0903-rhel9-Revert-profiles-add-support-for-resolved.patch
-Patch0904:  0904-rhel9-remove-nis-support.patch
 Patch0905:  0905-rhel9-Revert-yescrypt.patch
 
 %global makedir %{_builddir}/%{name}-%{version}
@@ -151,6 +150,7 @@
 %dir %{_datadir}/authselect/vendor
 %dir %{_datadir}/authselect/default
 %dir %{_datadir}/authselect/default/minimal/
+%dir %{_datadir}/authselect/default/nis/
 %dir %{_datadir}/authselect/default/sssd/
 %dir %{_datadir}/authselect/default/winbind/
 %{_datadir}/authselect/default/minimal/dconf-db
@@ -163,6 +163,16 @@
 %{_datadir}/authselect/default/minimal/REQUIREMENTS
 %{_datadir}/authselect/default/minimal/smartcard-auth
 %{_datadir}/authselect/default/minimal/system-auth
+%{_datadir}/authselect/default/nis/dconf-db
+%{_datadir}/authselect/default/nis/dconf-locks
+%{_datadir}/authselect/default/nis/fingerprint-auth
+%{_datadir}/authselect/default/nis/nsswitch.conf
+%{_datadir}/authselect/default/nis/password-auth
+%{_datadir}/authselect/default/nis/postlogin
+%{_datadir}/authselect/default/nis/README
+%{_datadir}/authselect/default/nis/REQUIREMENTS
+%{_datadir}/authselect/default/nis/smartcard-auth
+%{_datadir}/authselect/default/nis/system-auth
 %{_datadir}/authselect/default/sssd/dconf-db
 %{_datadir}/authselect/default/sssd/dconf-locks
 %{_datadir}/authselect/default/sssd/fingerprint-auth
[root@rockylinux9 ~]# dnf --enablerepo=devel install libcmocka-devel popt-devel po4a python3-devel
[root@rockylinux9 ~]# rpmbuild -bb rpmbuild/SPECS/authselect.spec
[root@rockylinux9 ~]# ls -l rpmbuild/RPMS/x86_64/authselect-*
-rw-r--r--. 1 root root 143120 Oct 14 01:03 rpmbuild/RPMS/x86_64/authselect-1.2.6-2.el9.x86_64.rpm
-rw-r--r--. 1 root root  33165 Oct 14 01:03 rpmbuild/RPMS/x86_64/authselect-compat-1.2.6-2.el9.x86_64.rpm
-rw-r--r--. 1 root root  38782 Oct 14 01:03 rpmbuild/RPMS/x86_64/authselect-debuginfo-1.2.6-2.el9.x86_64.rpm
-rw-r--r--. 1 root root  51186 Oct 14 01:03 rpmbuild/RPMS/x86_64/authselect-debugsource-1.2.6-2.el9.x86_64.rpm
-rw-r--r--. 1 root root  12093 Oct 14 01:03 rpmbuild/RPMS/x86_64/authselect-devel-1.2.6-2.el9.x86_64.rpm
-rw-r--r--. 1 root root 242934 Oct 14 01:03 rpmbuild/RPMS/x86_64/authselect-libs-1.2.6-2.el9.x86_64.rpm
-rw-r--r--. 1 root root  97197 Oct 14 01:03 rpmbuild/RPMS/x86_64/authselect-libs-debuginfo-1.2.6-2.el9.x86_64.rpm
[root@rockylinux9 ~]#
 
[root@rockylinux9 ~]# dnf reinstall rpmbuild/RPMS/x86_64/authselect-libs-1.2.6-2.el9.x86_64.rpm
 
[root@rockylinux9 ~]# authselect list
- minimal        Local users only for minimal installations
- nis            Enable NIS for system authentication
- sssd           Enable SSSD for system authentication (also for local users only)
- winbind        Enable winbind for system authentication
[root@rockylinux9 ~]#
 
 
 
[root@rockylinux9 ~]# authselect select nis --force

これでnisサーバからアカウント情報が引けます.

RHEL9でサポートから外したnisを復活させてみたけど、自己責任. でもそもそもRHELとか使ってもRHELは瑕疵に賠償はせんよな

autofs

忘れてたautofsもnis対応に戻します

[root@rockylinux9 ~]# curl -O http://dl.rockylinux.org/pub/rocky/9/devel/source/tree/Packages/a/autofs-5.1.7-58.el9.src.rpm
 
[root@rockylinux9 ~]# rpm -Uvh autofs-5.1.7-58.el9.src.rpm
[root@rockylinux9 ~]# vi rpmbuild/SOURCES/autofs-5.1.7-fix-dangling-symlink-creation-if-nis-support-is-not-available.patch
--- rpmbuild/SOURCES/autofs-5.1.7-fix-dangling-symlink-creation-if-nis-support-is-not-available.patch.orig      2024-04-18 07:48:29.000000000 +0900
+++ rpmbuild/SOURCES/autofs-5.1.7-fix-dangling-symlink-creation-if-nis-support-is-not-available.patch   2024-10-14 01:07:03.750097377 +0900
@@ -21,15 +21,3 @@
 
  25/01/2021 autofs-5.1.7
  - make bind mounts propagation slave by default.
---- autofs-5.1.7.orig/modules/Makefile
-+++ autofs-5.1.7/modules/Makefile
-@@ -77,7 +77,9 @@ install: all
-       install -c $(MODS) -m 755 $(INSTALLROOT)$(autofslibdir)
-       -rm -f $(INSTALLROOT)$(autofslibdir)/mount_smbfs.so
-       ln -fs lookup_file.so $(INSTALLROOT)$(autofslibdir)/lookup_files.so
-+ifeq ($(YPCLNT), 1)
-       ln -fs lookup_yp.so $(INSTALLROOT)$(autofslibdir)/lookup_nis.so
-+endif
- ifeq ($(LDAP), 1)
-       ln -fs lookup_ldap.so $(INSTALLROOT)$(autofslibdir)/lookup_ldaps.so
- endif
[root@rockylinux9 ~]# dnf install cyrus-sasl-devel krb5-devel libsss_autofs libxml2-devel openldap-devel
 
[root@rockylinux9 ~]# rpmbuild -bb rpmbuild/SPECS/autofs.spec
 
[root@rockylinux9 ~]# ls -l rpmbuild/RPMS/x86_64/autofs-*
-rw-r--r--. 1 root root 385292 Oct 14 01:08 rpmbuild/RPMS/x86_64/autofs-5.1.7-58.el9.x86_64.rpm
-rw-r--r--. 1 root root 725206 Oct 14 01:08 rpmbuild/RPMS/x86_64/autofs-debuginfo-5.1.7-58.el9.x86_64.rpm
-rw-r--r--. 1 root root 270815 Oct 14 01:08 rpmbuild/RPMS/x86_64/autofs-debugsource-5.1.7-58.el9.x86_64.rpm
[root@rockylinux9 ~]#
 
[root@rockylinux9 ~]# dnf install nfs-utils
[root@rockylinux9 ~]# dnf localinstall rpmbuild/RPMS/x86_64/autofs-5.1.7-58.el9.x86_64.rpm
 
(既にautofsが入っていたら)
[root@rockylinux9 ~]# dnf reinstall rpmbuild/RPMS/x86_64/autofs-5.1.7-58.el9.x86_64.rpm

ypserv

本家様 https://github.com/thkukuk/ypserv
nisサーバもrockylinux9 で賄うなら.

[root@rockylinux9 ~]# curl -O http://dl.rockylinux.org/pub/rocky/8/AppStream/source/tree/Packages/y/ypserv-4.1-1.el8.src.rpm
 
[root@rockylinux9 ~]# rpm -Uvh ypserv-4.1-1.el8.src.rpm
 
[root@rockylinux9 ~]# git clone https://github.com/thkukuk/ypserv
[root@rockylinux9 ~]# cd ypserv
[root@rockylinux9 ypserv]# git checkout v4.2
[root@rockylinux9 ypserv]# cd ..
[root@rockylinux9 ~]# 
[root@rockylinux9 ~]# tar --exclude-vcs --transform 's/ypserv/ypserv-4.2/' -cvzf ypserv-4.2.tar.gz ypserv
[root@rockylinux9 ~]# cp ypserv-4.2.tar.gz rpmbuild/SOURCES/
 
[root@rockylinux9 ~]# vi rpmbuild/SPECS/ypserv.spec

rockylinux8のypservを参照に作ります

--- rpmbuild/SPECS/ypserv.spec.orig     2022-04-17 10:11:09.000000000 +0900
+++ rpmbuild/SPECS/ypserv.spec  2023-08-22 20:32:33.738889909 +0900
@@ -3,11 +3,11 @@
 Summary: The NIS (Network Information Service) server
 Url: http://www.linux-nis.org/nis/ypserv/index.html
 Name: ypserv
-Version: 4.1
+Version: 4.2
 Release: 1%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
-Source0: https://github.com/thkukuk/%{name}/archive/v%{version}.tar.gz
+Source0: https://github.com/thkukuk/%{name}/archive/v%{version}.tar.gz#/ypserv-%{version}.tar.gz
 Source1: ypserv.service
 Source2: yppasswdd.service
 Source3: ypxfrd.service
[root@rockylinux9 ~]# dnf --enablerepo=devel install tokyocabinet-devel libnsl2-devel libtirpc-devel systemd-devel
[root@rockylinux9 ~]# rpmbuild -bb rpmbuild/SPECS/ypserv.spec
[root@rockylinux9 ~]# ls -l rpmbuild/RPMS/x86_64/ypserv-*
-rw-r--r--. 1 root root 156556 Oct 14 01:11 rpmbuild/RPMS/x86_64/ypserv-4.2-1.el9.x86_64.rpm
-rw-r--r--. 1 root root 198005 Oct 14 01:11 rpmbuild/RPMS/x86_64/ypserv-debuginfo-4.2-1.el9.x86_64.rpm
-rw-r--r--. 1 root root  64892 Oct 14 01:11 rpmbuild/RPMS/x86_64/ypserv-debugsource-4.2-1.el9.x86_64.rpm
[root@rockylinux9 ~]#

update禁止

dnfで上書きされて困るので「/etc/yum.conf」に下記を加えておく

exclude=ypbind nss_nis yp-tools authselect-libs autofs
最新の60件
2024-12-08 2024-12-05 2024-12-04 2024-11-28 2024-11-23 2024-11-22 2024-11-15 2024-11-14 2024-11-12 2024-11-06 2024-11-05 2024-11-04 2024-11-02 2024-11-01 2024-10-29 2024-10-28 2024-10-27 2024-10-23 2024-10-18 2024-10-17
  • NIS/rockylinux9
2024-10-15 2024-10-14 2024-10-13 2024-10-11 2024-10-10 2024-10-09 2024-10-08 2024-10-05 2024-10-04 2024-10-03 2024-10-02 2024-10-01 2024-09-30 2024-09-29 2024-09-28 2024-09-27 2024-09-22 2024-09-20 2024-09-17

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2024-10-17 (木) 01:16:24