jueves, 25 de abril de 2013

Buscar binarios en los repositorios

Hoy estaba buscando un ejecutable en RHEL6 semanage,  para la administración de SELinux. Parece que no está instalado por defecto. Para buscar un binario en los repositorios:

 [root@server1 ~]# yum whatprovides *semanage
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
libsemanage-2.0.43-4.2.el6.x86_64 : SELinux binary policy manipulation library
Repo        : www-repo
Matched from:
Other       : libsemanage = 2.0.43-4.2.el6

policycoreutils-python-2.0.83-19.30.el6.x86_64 : SELinux policy core python
                                               : utilities
Repo        : www-repo
Matched from:
Filename    : /usr/sbin/semanage


libsemanage-2.0.43-4.2.el6.i686 : SELinux binary policy manipulation library
Repo        : www-repo
Matched from:
Other       : libsemanage = 2.0.43-4.2.el6

libsemanage-2.0.43-4.2.el6.x86_64 : SELinux binary policy manipulation library
Repo        : installed
Matched from:


En este caso el que busco es /usr/sbin/semanage que lo proporciona el paquete policycoreutils-python, lo instalamos.

[root@server1 ~]# yum install policycoreutils-python
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package policycoreutils-python.x86_64 0:2.0.83-19.30.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================
 Package                     Arch        Version                Repository     Size
====================================================================================
Installing:
 policycoreutils-python      x86_64      2.0.83-19.30.el6       www-repo      342 k

Transaction Summary
====================================================================================
Install       1 Package(s)

Total download size: 342 k
Installed size: 920 k
Is this ok [y/N]: y
Downloading Packages:
policycoreutils-python-2.0.83-19.30.el6.x86_64.rpm           | 342 kB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : policycoreutils-python-2.0.83-19.30.el6.x86_64                   1/1
  Verifying  : policycoreutils-python-2.0.83-19.30.el6.x86_64                   1/1

Installed:
  policycoreutils-python.x86_64 0:2.0.83-19.30.el6                                 

Complete!

Ya tenemos el binario:

[root@server1 ~]# semanage
/usr/sbin/semanage:
semanage [ -S store ] -i [ input_file | - ]
semanage [ -S store ] -o [ output_file | - ]

semanage login -{a|d|m|l|D|E} [-nrs] login_name | %groupname
semanage user -{a|d|m|l|D|E} [-LnrRP] selinux_name
semanage port -{a|d|m|l|D|E} [-nrt] [ -p proto ] port | port_range
semanage interface -{a|d|m|l|D|E} [-nrt] interface_spec
semanage module -{a|d|m} [--enable|--disable] module
semanage node -{a|d|m|l|D|E} [-nrt] [ -p protocol ] [-M netmask] addr
semanage fcontext -{a|d|m|l|D|E} [-efnrst] file_spec
semanage boolean -{d|m} [--on|--off|-1|-0] -F boolean | boolean_file
semanage permissive -{d|a|l} [-n] type
semanage dontaudit [ on | off ]

Primary Options:

        -a, --add        Add a OBJECT record NAME
        -d, --delete     Delete a OBJECT record NAME
        -m, --modify     Modify a OBJECT record NAME
        -i, --input      Input multiple semange commands in a transaction
        -o, --output     Output current customizations as semange commands
        -l, --list       List the OBJECTS
        -E, --extract    extract customizable commands
        -C, --locallist  List OBJECTS local customizations
        -D, --deleteall  Remove all OBJECTS local customizations

        -h, --help       Display this message
        -n, --noheading  Do not print heading when listing OBJECTS
        -S, --store      Select and alternate SELinux store to manage

Object-specific Options (see above):

        -f, --ftype      File Type of OBJECT
                "" (all files)
                -- (regular file)
                -d (directory)
                -c (character device)
                -b (block device)
                -s (socket)
                -l (symbolic link)
                -p (named pipe)

        -F, --file       Treat target as an input file for command, change multiple settings
        -p, --proto      Port protocol (tcp or udp) or internet protocol version of node (ipv4 or ipv6)
        -M, --mask       Netmask
        -e, --equal      Substitue source path for dest path when labeling
        -P, --prefix     Prefix for home directory labeling
        -L, --level      Default SELinux Level (MLS/MCS Systems only)
        -R, --roles      SELinux Roles (ex: "sysadm_r staff_r")
        -s, --seuser     SELinux User Name
        -t, --type       SELinux Type for the object
        -r, --range      MLS/MCS Security Range (MLS/MCS Systems only)
        --enable         Enable a module
        --disable        Disable a module

Requires 2 or more arguments

Saludos.


No hay comentarios:

Publicar un comentario