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.2 (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/
 :
-rw-r--r--. 1 root root    53345 Aug 22 20:11 ypbind-2.7.2-2.el9.x86_64.rpm
-rw-r--r--. 1 root root    61837 Aug 22 20:11 ypbind-debuginfo-2.7.2-2.el9.x86_64.rpm
-rw-r--r--. 1 root root    27265 Aug 22 20:11 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/
 :
-rw-r--r--. 1 root root    41538 Aug 22 20:16 nss_nis-3.2-8.el9.x86_64.rpm
-rw-r--r--. 1 root root    78837 Aug 22 20:16 nss_nis-debuginfo-3.2-8.el9.x86_64.rpm
-rw-r--r--. 1 root root    28064 Aug 22 20:16 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/
 :
-rw-r--r--. 1 root root    82654 Aug 22 20:18 yp-tools-4.2.3-2.el9.x86_64.rpm
-rw-r--r--. 1 root root    92675 Aug 22 20:18 yp-tools-debuginfo-4.2.3-2.el9.x86_64.rpm
-rw-r--r--. 1 root root    26835 Aug 22 20:18 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-1.el9.src.rpm
[root@rockylinux9 ~]# rpm -Uvh authselect-1.2.6-1.el9.src.rpm
[root@rockylinux9 ~]# vi rpmbuild/SPECS/authselect.spec
--- rpmbuild/SPECS/authselect.spec.orig 2023-08-23 21:19:48.711224985 +0900
+++ rpmbuild/SPECS/authselect.spec      2023-08-23 21:21:18.656134493 +0900
@@ -16,7 +16,7 @@
 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
+#Patch0904:  0904-rhel9-remove-nis-support.patch
 Patch0905:  0905-rhel9-Revert-yescrypt.patch
 
 %global makedir %{_builddir}/%{name}-%{version}
@@ -153,6 +153,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
@@ -165,6 +166,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/
 :
-rw-r--r--. 1 root root   143638 Aug 23 21:26 authselect-1.2.6-1.el9.x86_64.rpm
-rw-r--r--. 1 root root    34195 Aug 23 21:26 authselect-compat-1.2.6-1.el9.x86_64.rpm
-rw-r--r--. 1 root root    40479 Aug 23 21:26 authselect-debuginfo-1.2.6-1.el9.x86_64.rpm
-rw-r--r--. 1 root root    52210 Aug 23 21:26 authselect-debugsource-1.2.6-1.el9.x86_64.rpm
-rw-r--r--. 1 root root    13120 Aug 23 21:26 authselect-devel-1.2.6-1.el9.x86_64.rpm
-rw-r--r--. 1 root root   241447 Aug 23 21:26 authselect-libs-1.2.6-1.el9.x86_64.rpm
-rw-r--r--. 1 root root   100038 Aug 23 21:26 authselect-libs-debuginfo-1.2.6-1.el9.x86_64.rpm
 :
[root@rockylinux9 ~]#
 
[root@rockylinux9 ~]# dnf reinstall rpmbuild/RPMS/x86_64/authselect-libs-1.2.6-1.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-36.el9.src.rpm
[root@rockylinux9 ~]# rpm -Uvh autofs-5.1.7-36.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      2022-12-25 14:51:33.725378859 +0900
+++ rpmbuild/SOURCES/autofs-5.1.7-fix-dangling-symlink-creation-if-nis-support-is-not-available.patch   2022-12-25 14:51:40.132430213 +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/
 :
-rw-r--r--. 1 root root 384404 Aug 27 13:16 autofs-5.1.7-36.el9.x86_64.rpm
-rw-r--r--. 1 root root 740587 Aug 27 13:16 autofs-debuginfo-5.1.7-36.el9.x86_64.rpm
-rw-r--r--. 1 root root 273302 Aug 27 13:16 autofs-debugsource-5.1.7-36.el9.x86_64.rpm
 :
[root@rockylinux9 ~]#
 
[root@rockylinux9 ~]# dnf install nfs-utils
[root@rockylinux9 ~]# dnf localinstall rpmbuild/RPMS/x86_64/autofs-5.1.7-36.el9.x86_64.rpm
 
(既にautofsが入っていたら)
[root@rockylinux9 ~]# dnf reinstall rpmbuild/RPMS/x86_64/autofs-5.1.7-36.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 154695 Aug 22 20:33 rpmbuild/RPMS/x86_64/ypserv-4.2-1.el9.x86_64.rpm
-rw-r--r--. 1 root root 200012 Aug 22 20:33 rpmbuild/RPMS/x86_64/ypserv-debuginfo-4.2-1.el9.x86_64.rpm
-rw-r--r--. 1 root root  64847 Aug 22 20:33 rpmbuild/RPMS/x86_64/ypserv-debugsource-4.2-1.el9.x86_64.rpm
[root@rockylinux9 ~]#
最新の60件
2024-02-23 2024-02-22 2024-02-21 2024-02-20 2024-02-19 2024-02-18 2024-02-17 2024-02-16 2024-02-13 2024-02-12 2024-02-09 2024-02-04 2024-02-03 2024-01-31 2024-01-30 2024-01-29 2024-01-28 2024-01-22 2024-01-16 2024-01-15 2024-01-13 2024-01-12 2024-01-09 2024-01-08 2024-01-07 2024-01-03 2023-12-22 2023-12-17 2023-12-16 2023-12-11 2023-12-09 2023-12-06 2023-11-30 2023-11-27 2023-11-21 2023-11-19 2023-11-18 2023-11-14 2023-11-10 2023-11-09 2023-11-05 2023-11-03 2023-10-30 2023-10-26

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-09-08 (金) 05:00:23