Estoy tratando de configurar un pgadmin4 con valores de contexto de seguridad correctos y predeterminados usando un setup-web.sh texto. tiene comando de gestión para realizar cambios en la política de SELinux para permitir el acceso a pgAdmin, pero de repente me encontré con el siguiente error.
[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
El error fue que semanage comando no encontrado.
semanejo
El semanaje el comando es un SELinux (Seguridad –Linux mejorado ) herramienta de administración que se utiliza para configurar elementos específicos sin realizar ningún ajuste o volver a ensamblar desde fuentes de políticas. Semanage consiste en mapear desde el nombre de usuario de Linux a las identidades de usuario de SELinux y también incluye mapear el contexto de seguridad para numerosos tipos de objetos como interfaz, puerto de red, etc.
Necesitas usar yum proporciona , esta opción para averiguar el paquete que proporciona el archivo consultado se llama /usr/sbin/semanage .
Explicaremos cómo instalar los paquetes necesarios para obtener comando semanage usando el comando 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
Puede ver que necesitamos instalar policycoreutils-python-utils-2.9-14.el8.noarch paquete para usar el semanage comando.
[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!
Intente ejecutar el comando semanage de nuevo, funcionará como magia.
También puede usar los siguientes comandos para obtener la página del manual en semanage command opciones y uso.
# man semanage
# semanage --help
También puedo verificar eso ejecutando mi setup-web.sh guión de nuevo.
[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
Se ejecutó correctamente.