miércoles, 21 de diciembre de 2011

LINUX: instalación con YUM

YUM

Uso de herramienta yum (por defecto busca los paquetes desde los repo de internet):

search
[root@gcepedar CentOS]# yum search ricci
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.netglobalis.net
* updates: mirror.netglobalis.net
* addons: mirror.netglobalis.net
* extras: mirror.netglobalis.net
================================== Matched: ricci ===================================
luci.i386 : Remote Management System - Management Station
ricci.i386 : Remote Management System - Managed Station
[root@gcepedar CentOS]#

LINUX: tips rpm

¿cómo instalar un paquete rpm?
$rpm -Ivh paquete.rpm
donde I: instalar
v: vervose, indica el estado de la instalación.

A menudo es necesario conocer la siguiente info después de instalar un paquete rpm.

contar todos los rpm instalados en el server
[root@gcepedar ~]# rpm -qa | wc -l

si se saca el atributo "| wc -l" entrega una lista de todos los paquetes instalados en el server.

martes, 20 de diciembre de 2011

LINUX: mensaje de bienvenida al server.

$ sudo vi /etc/motd

en el siguiente link existe una variedad de imagenes ascii para complementar el mensaje:
http://www.chris.com/ascii/index.php

LINUX: tips syslog

revisar syslog
[root@localhost home]# tail -f /var/log/messages
Aug 12 13:55:37 localhost nm-system-settings: ifcfg-rh: parsing /etc/sysconfig/network-scripts/ifcfg-eth0 ...


Reseteo del syslog
[root@localhost home]# /etc/init.d/syslog restart
Shutting down kernel logger: [ OK ]
Shutting down system logger: [ OK ]
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
[root@localhost home]#


agregar logs al syslog
[root@localhost home]# vi /etc/syslog.conf
*.* /dev/tty12
*.* /var/log/auditoria.log
*.* @192.168.0.5

logrotate
[root@localhost home]# vi /etc/logrotate.conf

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}

LINUX: tips TTY y PTS

TTY son terminales dentro de la misma maquina.Abiertas por el mismo usuario
PTS: sesiones remotas en la maquina

listar todas las sesiones:
[root@ns ~]# w
20:09:18 up 28 min, 6 users, load average: 0.00, 0.02, 0.03
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 - 19:59 8:17 0.01s 0.00s vi /etc/inittab
root tty2 - 20:07 34.00s 0.02s 0.02s -bash
root pts/1 192.168.100.170 20:08 0.00s 0.02s 0.00s w
root pts/2 192.168.100.101 20:08 5.00s 0.01s 0.00s wall
root pts/3 192.168.100.54 20:08 25.00s 0.01s 0.01s -bash
root pts/4 192.168.100.142 20:09 3.00s 0.02s 0.02s -bash


Bloquear todas las TTY en la maquina
Se comentan estas lineas en el archivo inittab:
[root@localhost ~]# vi /etc/inittab


# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6


Servicios de Networking Habilitados y en listen.
[root@localhost ~]# netstat -atunp | grep -i list
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 2958/hpiod
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2733/portmap
tcp 0 0 0.0.0.0:820 0.0.0.0:* LISTEN 2758/rpc.statd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2989/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3009/sendmail: acce
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 2963/python
tcp 0 0 :::22 :::* LISTEN 2978/sshd
[root@localhost ~]#

LINUX: tips niveles de arranque (Genérico).

En cualquier S.O linux se puede aplicar los siguientes tips de niveles de arranque.

Ejemplo:
Buscando el servicio cups dentro del directorio runlevel 3


[root@localhost ~]# l /etc/rc.d/rc3.d/S56cups
lrwxrwxrwx 1 root root 14 Aug 12 13:37 /etc/rc.d/rc3.d/S56cups -> ../init.d/cups
[root@localhost ~]#