Saya mencoba mengonfigurasi pgadmin4 dengan nilai konteks keamanan yang benar dan default menggunakan setup-web.sh naskah. ia memiliki perintah semanage untuk membuat perubahan dalam kebijakan SELinux untuk mengizinkan akses ke pgAdmin tetapi tiba-tiba saya mengalami kesalahan berikut.
[root@unixcop ~]# /usr/pgadmin4/bin/setup-web.sh
Setting up pgAdmin 4 in web mode on a Redhat based platform...
Creating configuration database...
pgAdmin 4 - Application Initialisation
======================================
Creating storage and log directories...
Configuring SELinux...
/usr/pgadmin4/bin/setup-web.sh: line 87: semanage: command not found
/usr/pgadmin4/bin/setup-web.sh: line 89: semanage: command not found
The Apache web server is running and must be restarted for the pgAdmin 4 installation to complete. Continue (y/n)? y
Apache successfully restarted. You can now start using pgAdmin 4 in web mode at http://127.0.0.1/pgadmin4
Kesalahannya adalah semanage perintah tidak ditemukan.
manajemen
manajemen perintahnya adalah SELinux (Keamanan –Linux yang Disempurnakan ) alat manajemen yang digunakan untuk mengonfigurasi elemen tertentu tanpa membuat penyesuaian apa pun atau menyusun kembali dari sumber kebijakan. Semanage terdiri dari pemetaan dari nama pengguna Linux ke identitas pengguna SELinux dan juga mencakup pemetaan konteks keamanan untuk berbagai jenis objek seperti antarmuka, port jaringan, dll.
Anda perlu menggunakan yum menyediakan , opsi ini untuk mengetahui paket yang menyediakan file kueri bernama /usr/sbin/semanage .
Kami akan menjelaskan cara menginstal paket yang diperlukan untuk mendapatkan perintah semanage menggunakan perintah yum.
[root@unixcop ~]# yum provides /usr/sbin/semanage
Last metadata expiration check: 0:20:11 ago on Mon Aug 9 10:46:23 2021.
policycoreutils-python-utils-2.9-14.el8.noarch : SELinux policy core python utilities
Repo : baseos
Matched from:
Filename : /usr/sbin/semanage
Anda dapat melihat bahwa kami perlu menginstal policycoreutils-python-utils-2.9-14.el8.noarch paket untuk menggunakan semanage perintah.
[root@unixcop ~]# yum install policycoreutils-python-utils
Last metadata expiration check: 0:20:24 ago on Mon Aug 9 10:46:23 2021.
Dependencies resolved.
======================================================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================================================
Installing:
policycoreutils-python-utils noarch 2.9-14.el8 baseos 252 k
Installing dependencies:
checkpolicy x86_64 2.9-1.el8 baseos 348 k
python3-audit x86_64 3.0-0.17.20191104git1c2f876.el8 baseos 86 k
python3-libsemanage x86_64 2.9-6.el8 baseos 127 k
python3-policycoreutils noarch 2.9-14.el8 baseos 2.2 M
python3-setools x86_64 4.3.0-2.el8 baseos 626 k
Transaction Summary
======================================================================================================================================================
Install 6 Packages
Total download size: 3.6 M
Installed size: 11 M
Is this ok [y/N]: Operation aborted.
[root@unixcop ~]# yum install policycoreutils-python-utils
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:20:29 ago on Mon Aug 9 10:46:23 2021.
Dependencies resolved.
======================================================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================================================
Installing:
policycoreutils-python-utils noarch 2.9-14.el8 baseos 252 k
Installing dependencies:
checkpolicy x86_64 2.9-1.el8 baseos 348 k
python3-audit x86_64 3.0-0.17.20191104git1c2f876.el8 baseos 86 k
python3-libsemanage x86_64 2.9-6.el8 baseos 127 k
python3-policycoreutils noarch 2.9-14.el8 baseos 2.2 M
python3-setools x86_64 4.3.0-2.el8 baseos 626 k
Transaction Summary
======================================================================================================================================================
Install 6 Packages
Total download size: 3.6 M
Installed size: 11 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64.rpm 66 kB/s | 86 kB 00:01
(2/6): python3-libsemanage-2.9-6.el8.x86_64.rpm 113 kB/s | 127 kB 00:01
(3/6): policycoreutils-python-utils-2.9-14.el8.noarch.rpm 98 kB/s | 252 kB 00:02
(4/6): checkpolicy-2.9-1.el8.x86_64.rpm 94 kB/s | 348 kB 00:03
(5/6): python3-setools-4.3.0-2.el8.x86_64.rpm 172 kB/s | 626 kB 00:03
(6/6): python3-policycoreutils-2.9-14.el8.noarch.rpm 223 kB/s | 2.2 MB 00:10
------------------------------------------------------------------------------------------------------------------------------------------------------
Total 279 kB/s | 3.6 MB 00:13
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-setools-4.3.0-2.el8.x86_64 1/6
Installing : python3-libsemanage-2.9-6.el8.x86_64 2/6
Installing : python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64 3/6
Installing : checkpolicy-2.9-1.el8.x86_64 4/6
Installing : python3-policycoreutils-2.9-14.el8.noarch 5/6
Installing : policycoreutils-python-utils-2.9-14.el8.noarch 6/6
Running scriptlet: policycoreutils-python-utils-2.9-14.el8.noarch 6/6
Verifying : checkpolicy-2.9-1.el8.x86_64 1/6
Verifying : policycoreutils-python-utils-2.9-14.el8.noarch 2/6
Verifying : python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64 3/6
Verifying : python3-libsemanage-2.9-6.el8.x86_64 4/6
Verifying : python3-policycoreutils-2.9-14.el8.noarch 5/6
Verifying : python3-setools-4.3.0-2.el8.x86_64 6/6
Installed:
checkpolicy-2.9-1.el8.x86_64 policycoreutils-python-utils-2.9-14.el8.noarch python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64
python3-libsemanage-2.9-6.el8.x86_64 python3-policycoreutils-2.9-14.el8.noarch python3-setools-4.3.0-2.el8.x86_64
Complete!
Coba jalankan perintah semanage sekali lagi, ini akan bekerja seperti sulap.
Anda juga dapat menggunakan perintah berikut untuk mendapatkan halaman manual di perintah semanage pilihan dan penggunaan.
# man semanage
# semanage --help
Saya juga dapat memeriksanya dengan menjalankan setup-web.sh saya skrip lagi.
[root@unixcop ~]# /usr/pgadmin4/bin/setup-web.sh
Setting up pgAdmin 4 in web mode on a Redhat based platform...
Creating configuration database...
pgAdmin 4 - Application Initialisation
======================================
Creating storage and log directories...
Configuring SELinux...
The Apache web server is running and must be restarted for the pgAdmin 4 installation to complete. Continue (y/n)? y
Apache successfully restarted. You can now start using pgAdmin 4 in web mode at http://127.0.0.1/pgadmin4
Itu dijalankan dengan benar.