GNU/Linux >> Tutoriales Linux >  >> Cent OS

Cómo corregir el error de "comando de administración" no encontrado en CentOS

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 (SeguridadLinux 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.


Cent OS
  1. comando semanage no encontrado en CentOS 8 / RHEL 8

  2. Cómo corregir un error de Comando no encontrado en Linux

  3. Error:Comando de configuración no encontrado en CentOS VPS [Resuelto]

  4. “-bash:firewall:comando no encontrado” – Cómo resolver en CentOS/RHEL 7

  5. Cómo resolver el error “-bash:xclock:comando no encontrado” en CentOS/RHEL

5 soluciones:cómo corregir el error "Comando Zsh no encontrado" en Linux o macOS

Cómo corregir el error "Comando Yum no encontrado" en Linux [Actualización 2022]

¿Hacer que el comando no se encuentre? Aquí está cómo solucionarlo

Cómo arreglar el comando Ifconfig no encontrado en CentOS 7

Cómo arreglar el comando Ifconfig no encontrado en Ubuntu 20.04 LTS

Cómo solucionarlo:el comando curl no encontró un error