RHEL9 Usermin をインストールする方法

環境
Red Hat Enterprise Linux release 9.2 (Plow)

概要
Web ブラウザーから一般ユーザーが自身のパスワード変更等の管理操作を行うことができる Usermin をインストールします。

操作手順
1. Perl モジュールをインストールします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf --enablerepo=epel -y install perl perl-Net-SSLeay perl-Authen-PAM
# dnf --enablerepo=epel -y install perl perl-Net-SSLeay perl-Authen-PAM
# dnf --enablerepo=epel -y install perl perl-Net-SSLeay perl-Authen-PAM

2. Usermin のインストールです。公式サイトで最新バージョンを確認の上、インストールください。
http://download.webmin.com/download/yum/

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf -y install http://download.webmin.com/download/yum/usermin-1.852-1.noarch.rpm
# vi /etc/usermin/miniserv.conf
# 最終行 : アクセス許可する IP アドレスを追記
allow=127.0.0.1 10.0.0.0/24
# root ログインは禁止する
denyusers=root
# dnf -y install http://download.webmin.com/download/yum/usermin-1.852-1.noarch.rpm # vi /etc/usermin/miniserv.conf # 最終行 : アクセス許可する IP アドレスを追記 allow=127.0.0.1 10.0.0.0/24 # root ログインは禁止する denyusers=root
# dnf -y install http://download.webmin.com/download/yum/usermin-1.852-1.noarch.rpm
# vi /etc/usermin/miniserv.conf
# 最終行 : アクセス許可する IP アドレスを追記
allow=127.0.0.1 10.0.0.0/24
# root ログインは禁止する
denyusers=root

userminを再起動

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# systemctl restart usermin
# systemctl restart usermin
# systemctl restart usermin

3. SELinux を有効にしている場合は、ポリシーを変更します
# vi usermin.te
# 新規作成

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
module usermin 1.0;
require {
type init_t;
type var_t;
class file { ioctl open read unlink };
}
#============= init_t ==============
allow init_t var_t:file { ioctl open read unlink };
module usermin 1.0; require { type init_t; type var_t; class file { ioctl open read unlink }; } #============= init_t ============== allow init_t var_t:file { ioctl open read unlink };
module usermin 1.0;

require {
        type init_t;
        type var_t;
        class file { ioctl open read unlink };
}

#============= init_t ==============
allow init_t var_t:file { ioctl open read unlink };

設定内容を反映します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# checkmodule -m -M -o usermin.mod usermin.te
# semodule_package --outfile usermin.pp --module usermin.mod
# semodule -i usermin.pp
# checkmodule -m -M -o usermin.mod usermin.te # semodule_package --outfile usermin.pp --module usermin.mod # semodule -i usermin.pp
# checkmodule -m -M -o usermin.mod usermin.te
# semodule_package --outfile usermin.pp --module usermin.mod
# semodule -i usermin.pp

4.Firewalld を有効にしている場合は、サービスポートの許可が必要です。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# firewall-cmd --add-port=20000/tcp
success
# firewall-cmd --runtime-to-permanent
success
# firewall-cmd --add-port=20000/tcp success # firewall-cmd --runtime-to-permanent success
# firewall-cmd --add-port=20000/tcp
success
# firewall-cmd --runtime-to-permanent
success

5. Web ブラウザーを起動し、[https://(サーバーのホスト名 または IP アドレス):20000/] へアクセスすると
Usermin の ログイン画面が表示されます。任意の OS 一般ユーザーでログイン可能です。

IT

Posted by arkgame