Ubuntu Sur

"Las personas nacen libres e iguales en dignidad y derechos"

Resucitando Ubuntu Sur!!!

Posteado por K|Ke en September 2nd, 2011

Hola todos, un gusto estar nuevamente escribiendo en el viejo blog de Ubuntu Sur y en lo posible también interactuar con todos ustedes.  Gracias a las gestiones de mi gran amigo Fabián (mama21mama), ahora el nuevo dominio http://www.ubuntusur.com.ar salvó el contenido del blog.  Por otra parte y debido al escaso tiempo que tengo para continuar escribiendo con la frecuencia que lo hacía antes, es que invito a ustedes poder colaborar con contenido para este proyecto que tiene algunos años de desarrollo.

Bueno cualquier sugerencia será siempre bienvenida, pueden ponerse en contacto a través del formulario si así lo desean.

Mis agradecimientos nuevamente a Fabián por el rescate de Ubuntu Sur.

Un gran saludo a todos ustedes.

K|Ke

Share

Posteado en Noticias | 2 Comentarios »

Ayuda para Ubuntu Sur!

Posteado por K|Ke en December 28th, 2009

Hola todos, no pensé algún día en abandonar tanto tiempo el proyecto ‘Ubuntu Sur’, pero debido a muchas otras obligaciones laborales no he podido continuar con la habitualidad que lo hacía, es decir, escribiendo post para ayudar en alguna medida a la comunidad de software libre. Invito a quien desee aportar con conocimientos y continuar escribiendo o editando material en el sitio, se comunique a través del formulario de contacto y de ese modo preservar el proyecto.

Ubuntu Sur no tiene absolutamente ningún fin de lucro, el dominio es propio y los servidores en donde se aloja también, por lo que no existe problema al respecto para su mantención.

Ubuntu Sur fue creado el año 2006, con el propósito inicial de servir solamente a una comunidad reducida de usuarios de Ubuntu de América del Sur, pero el 15 de abril del 2007 decidí liberar el acceso, con la finalidad de que pueda ser visitada por cualquier persona y contribuir de este modo con la promoción del sistema operativo GNU/Linux.

Espero poder contar con algún voluntario o voluntarios para continuar con el aporte a Ubuntu y Linux en general.

Un afectuoso saludo a todos.

K|Ke

Share

Posteado en Otro | 3 Comentarios »

Liberar memoria RAM cache

Posteado por K|Ke en September 25th, 2009

Un cache es un sistema especial de almacenamiento de alta velocidad. Puede ser tanto un área reservada de la memoria principal como un dispositivo de almacenamiento de alta velocidad independiente. Hay dos tipos de cache frecuentemente usados en las computadoras personales: memoria cache y cache de disco. Una memoria cache, llamada también a veces almacenamiento cache o RAM cache, es una parte de memoria RAM estática de alta velocidad (SRAM) más que la lenta y barata RAM dinámica (DRAM) usada como memoria principal. La memoria cache es efectiva dado que los programas acceden una y otra vez a los mismos datos o instrucciones. Guardando esta información en SRAM, la computadora evita acceder a la lenta DRAM.

Cuando un dato es encontrado en la cache, se dice que se ha producido un impacto (hit), siendo un cache juzgado por su tasa de impactos (hit rate). Los sistemas de memoria cache usan una tecnología conocida por cache inteligente en el cual el sistema puede reconocer cierto tipo de datos usados frecuentemente. Las estrategias para determinar qué información debe de ser puesta en el cache constituyen uno de los problemas más interesantes en la ciencia de las computadoras. Algunas memorias cache están construidas en la arquitectura de los microprocesadores. Por ejemplo, el procesador Pentium II tiene una cache L2 de 512 Kbytes.

El cache de disco trabaja sobre los mismos principios que la memoria cache, pero en lugar de usar SRAM de alta velocidad, usa la convencional memoria principal. Los datos más recientes del disco duro a los que se ha accedido (así como los sectores adyacentes) se almacenan en un buffer de memoria. Cuando el programa necesita acceder a datos del disco, lo primero que comprueba es la cache del disco para ver si los datos ya están ahí. La cache de disco puede mejorar drásticamente el rendimiento de las aplicaciones, dado que acceder a un byte de datos en RAM puede ser miles de veces más rápido que acceder a un byte del disco duro.

Fuente: Wikipedia

Esto es un recordartorio solamente, ya que en algunas ocasiones utilizo el comando con el fin de descargar aquella caché desde la ram de aquellas aplicaciones que no necesito continuar utilizando, aunque evidentemente que el sistema si requiere utilizar almacenamiento de datos en la caché y esta se encuentra utilizada, administrará correctamente la ram descargando aquella que sea de menos utilización, pero bueno, el comando es el siguiente:

# echo 3 > /proc/sys/vm/drop_caches

Share

Posteado en Software | 1 Comentario »

Prevenir intrusiones con fail2ban en Ubuntu y Ubuntu Server

Posteado por K|Ke en September 9th, 2009

fail2banFail2ban es un marco de prevención de intrusiones escrito en el lenguaje de programación Python. Es capaz de correr en sistemas POSIX que tienen una interfaz de control de paquetes o de firewall instalado localmente (por ejemplo, iptables o TCP Wrapper).

La principal función de Fail2ban es la de bloquear determinadas direcciones IP que pueden pertenecer a los hosts que están tratando de violar la seguridad del sistema. Determina los host a ser bloqueados por los archivos de registro de control (por ejemplo, /var/log/pwdfail, /var/log/auth.log, etc) y la prohibición de cualquier host IP que haga muchos intentos de acceso o realice cualquier acción no deseada dentro de un marco de tiempo definido por el administrador. fail2ban normalmente se establece un bloqueo de tiempo determinado, para no “banear” las conexiones reales que pueden haber sido temporalmente mal configuradas. Sin embargo, una prohibición de acceso de varios minutos suele ser suficiente para detener una conexión de red que está inundando de conexiones maliciosas el servidor, así como reducir la probabilidad de un ataque de diccionario.

Fail2ban puede realizar varias acciones cada vez que se detecta un abusol: Actualización de Netfilter/iptables reglas de firewall, o bien el archivo hosts.deny de TCP Wrappers, para rechazar la dirección IP de un abusador, efectuar notificaciones por correo electrónico, o cualquier acción definida por el usuario que puede llevarse a cabo por una secuencia de comandos Python.

La configuración estándar contiene filtros para Apache, Lighttpd, sshd, vsftpd, Qmail, Postfix y Courier Mail Server. Los filtros son definidos por expresiones regulares de Python, que puede ser convenientemente personalizada por un administrador familiarizado con instancias regulares. Una combinación de un filtro y una acción que se conoce como ‘jail’, causa el bloqueo de accesos maliciosos a los servicios de red especificados, así como los ejemplos que se distribuyen con el software, una “jail” se pueden crear para cualquier red y servicio que crea registros ‘logs’ de intentos de acceso.

Instalación en Ubuntu (repositorios universe)

$ sudo apt-get install fail2ban

El archivo de configuración lo encuentras en /etc/fail2ban/jail.conf

Luego de realizar la configuración adecuada, reiniciamos el servicio

$ sudo /etc/init.d/fail2ban restart

Nota: Si existiera algún error en Ubuntu 9.04 con la versión de python 2.6, la solución es instalar la versión 2.5 (sudo apt-get install python2.5) y luego cambiar la primera línea del archivo /usr/bin/fail2ban-server por esta:

#!/usr/bin/python2.5

Share

Posteado en Software | Sin Comentarios »

Mayor seguridad para el servidor SSH con Denyhosts

Posteado por K|Ke en September 7th, 2009

denyhosts_candadoDenyHosts es una herramienta de seguridad basada en Python para los servidores SSH. Su objetivo es prevenir los ataques por fuerza bruta en los servidores SSH mediante el seguimiento de intentos de acceso no válidos en el registro de autenticación y el bloqueo de las direcciones IP de origen. DenyHosts es desarrollado por Phil Schwartz, quien también es el desarrollador de Kodos y ReleaseForge.

La instalación la hacemos mediante APT

$ sudo apt-get install denyhosts

Luego de la instalación podremos ver y configurar el archivo /etc/denyhosts.conf

       ############ THESE SETTINGS ARE REQUIRED ############

########################################################################
#
# SECURE_LOG: the log file that contains sshd logging info
# if you are not sure, grep "sshd:" /var/log/*
#
# The file to process can be overridden with the --file command line
# argument
#
# Redhat or Fedora Core:
#SECURE_LOG = /var/log/secure
#
# Mandrake, FreeBSD or OpenBSD:
#SECURE_LOG = /var/log/auth.log
#
# SuSE:
#SECURE_LOG = /var/log/messages
#
# Mac OS X (v10.4 or greater -
#   also refer to:   http://www.denyhosts.net/faq.html#macos
#SECURE_LOG = /private/var/log/asl.log
#
# Mac OS X (v10.3 or earlier):
#SECURE_LOG=/private/var/log/system.log
#
# Debian:
SECURE_LOG = /var/log/auth.log
########################################################################

########################################################################
#
# HOSTS_DENY: the file which contains restricted host access information
#
# Most operating systems:
HOSTS_DENY = /etc/hosts.deny
#
# Some BSD (FreeBSD) Unixes:
#HOSTS_DENY = /etc/hosts.allow
#
# Another possibility (also see the next option):
#HOSTS_DENY = /etc/hosts.evil
#######################################################################

########################################################################
#
# PURGE_DENY: removed HOSTS_DENY entries that are older than this time
#             when DenyHosts is invoked with the --purge flag
#
#      format is: i[dhwmy]
#      Where 'i' is an integer (eg. 7)
#            'm' = minutes
#            'h' = hours
#            'd' = days
#            'w' = weeks
#            'y' = years
#
# never purge:
PURGE_DENY =
#
# purge entries older than 1 week
#PURGE_DENY = 1w
#
# purge entries older than 5 days
PURGE_DENY = 5d
#######################################################################

#######################################################################
#
# PURGE_THRESHOLD: defines the maximum times a host will be purged.
# Once this value has been exceeded then this host will not be purged.
# Setting this parameter to 0 (the default) disables this feature.
#
# default: a denied host can be purged/re-added indefinitely
PURGE_THRESHOLD = 0
#
# a denied host will be purged at most 2 times.
#PURGE_THRESHOLD = 2
#
#######################################################################

#######################################################################
#
# BLOCK_SERVICE: the service name that should be blocked in HOSTS_DENY
#
# man 5 hosts_access for details
#
# eg.   sshd: 127.0.0.1  # will block sshd logins from 127.0.0.1
#
# To block all services for the offending host:
#BLOCK_SERVICE = ALL
# To block only sshd:
BLOCK_SERVICE  = sshd
# To only record the offending host and nothing else (if using
# an auxilary file to list the hosts).  Refer to:
# http://denyhosts.sourceforge.net/faq.html#aux
#BLOCK_SERVICE =
#
#######################################################################

#######################################################################
#
# DENY_THRESHOLD_INVALID: block each host after the number of failed login
# attempts has exceeded this value.  This value applies to invalid
# user login attempts (eg. non-existent user accounts)
#
DENY_THRESHOLD_INVALID = 5
#
#######################################################################

#######################################################################
#
# DENY_THRESHOLD_VALID: block each host after the number of failed
# login attempts has exceeded this value.  This value applies to valid
# user login attempts (eg. user accounts that exist in /etc/passwd) except
# for the "root" user
#
DENY_THRESHOLD_VALID = 5
#
#######################################################################

#######################################################################
#
# DENY_THRESHOLD_ROOT: block each host after the number of failed
# login attempts has exceeded this value.  This value applies to
# "root" user login attempts only.
#
DENY_THRESHOLD_ROOT = 1
#
#######################################################################

#######################################################################
#
# DENY_THRESHOLD_RESTRICTED: block each host after the number of failed
# login attempts has exceeded this value.  This value applies to
# usernames that appear in the WORK_DIR/restricted-usernames file only.
#
DENY_THRESHOLD_RESTRICTED = 1
#
#######################################################################

#######################################################################
#
# WORK_DIR: the path that DenyHosts will use for writing data to
# (it will be created if it does not already exist).
#
# Note: it is recommended that you use an absolute pathname
# for this value (eg. /home/foo/denyhosts/data)
#
WORK_DIR = /var/lib/denyhosts
#
#######################################################################

#######################################################################
#
# SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS
#
# SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES|NO
# If set to YES, if a suspicious login attempt results from an allowed-host
# then it is considered suspicious.  If this is NO, then suspicious logins
# from allowed-hosts will not be reported.  All suspicious logins from
# ip addresses that are not in allowed-hosts will always be reported.
#
SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES
######################################################################

######################################################################
#
# HOSTNAME_LOOKUP
#
# HOSTNAME_LOOKUP=YES|NO
# If set to YES, for each IP address that is reported by Denyhosts,
# the corresponding hostname will be looked up and reported as well
# (if available).
#
HOSTNAME_LOOKUP=YES
#
######################################################################

######################################################################
#
# LOCK_FILE
#
# LOCK_FILE=/path/denyhosts
# If this file exists when DenyHosts is run, then DenyHosts will exit
# immediately.  Otherwise, this file will be created upon invocation
# and deleted upon exit.  This ensures that only one instance is
# running at a time.
#
# Redhat/Fedora:
#LOCK_FILE = /var/lock/subsys/denyhosts
#
# Debian
LOCK_FILE = /var/run/denyhosts.pid
#
# Misc
#LOCK_FILE = /tmp/denyhosts.lock
#
######################################################################

       ############ THESE SETTINGS ARE OPTIONAL ############

#######################################################################
#
# ADMIN_EMAIL: if you would like to receive emails regarding newly
# restricted hosts and suspicious logins, set this address to
# match your email address.  If you do not want to receive these reports
# leave this field blank (or run with the --noemail option)
#
# Multiple email addresses can be delimited by a comma, eg:
# ADMIN_EMAIL = foo@bar.com, bar@foo.com, etc@foobar.com
#
 ADMIN_EMAIL = you@yourdomain.com
#
#######################################################################

#######################################################################
#
# SMTP_HOST and SMTP_PORT: if DenyHosts is configured to email
# reports (see ADMIN_EMAIL) then these settings specify the
# email server address (SMTP_HOST) and the server port (SMTP_PORT)
#
#
 SMTP_HOST = mail.yourdomain.com
SMTP_PORT = 25
#
#######################################################################

#######################################################################
#
# SMTP_USERNAME and SMTP_PASSWORD: set these parameters if your
# smtp email server requires authentication
#
SMTP_USERNAME=you@yourdomain.com
SMTP_PASSWORD=your_password
#
######################################################################

#######################################################################
#
# SMTP_FROM: you can specify the "From:" address in messages sent
# from DenyHosts when it reports thwarted abuse attempts
#
SMTP_FROM = DenyHosts <nobody@localhost>
#
#######################################################################

#######################################################################
#
# SMTP_SUBJECT: you can specify the "Subject:" of messages sent
# by DenyHosts when it reports thwarted abuse attempts
 SMTP_SUBJECT = Possible SSH Attack
#
######################################################################

######################################################################
#
# SMTP_DATE_FORMAT: specifies the format used for the "Date:" header
# when sending email messages.
#
# for possible values for this parameter refer to: man strftime
#
# the default:
#
#SMTP_DATE_FORMAT = %a, %d %b %Y %H:%M:%S %z
#
######################################################################

######################################################################
#
# SYSLOG_REPORT
#
# SYSLOG_REPORT=YES|NO
# If set to yes, when denied hosts are recorded the report data
# will be sent to syslog (syslog must be present on your system).
# The default is: NO
#
#SYSLOG_REPORT=NO
#
#SYSLOG_REPORT=YES
#
######################################################################

######################################################################
#
# ALLOWED_HOSTS_HOSTNAME_LOOKUP
#
# ALLOWED_HOSTS_HOSTNAME_LOOKUP=YES|NO
# If set to YES, for each entry in the WORK_DIR/allowed-hosts file,
# the hostname will be looked up.  If your versions of tcp_wrappers
# and sshd sometimes log hostnames in addition to ip addresses
# then you may wish to specify this option.
#
#ALLOWED_HOSTS_HOSTNAME_LOOKUP=NO
#
######################################################################

######################################################################
#
# AGE_RESET_VALID: Specifies the period of time between failed login
# attempts that, when exceeded will result in the failed count for
# this host to be reset to 0.  This value applies to login attempts
# to all valid users (those within /etc/passwd) with the
# exception of root.  If not defined, this count will never
# be reset.
#
# See the comments in the PURGE_DENY section (above)
# for details on specifying this value or for complete details
# refer to:  http://denyhosts.sourceforge.net/faq.html#timespec
#
AGE_RESET_VALID=5m
#
######################################################################

######################################################################
#
# AGE_RESET_ROOT: Specifies the period of time between failed login
# attempts that, when exceeded will result in the failed count for
# this host to be reset to 0.  This value applies to all login
# attempts to the "root" user account.  If not defined,
# this count will never be reset.
#
# See the comments in the PURGE_DENY section (above)
# for details on specifying this value or for complete details
# refer to:  http://denyhosts.sourceforge.net/faq.html#timespec
#
AGE_RESET_ROOT=25d
#
######################################################################

######################################################################
#
# AGE_RESET_RESTRICTED: Specifies the period of time between failed login
# attempts that, when exceeded will result in the failed count for
# this host to be reset to 0.  This value applies to all login
# attempts to entries found in the WORK_DIR/restricted-usernames file.
# If not defined, the count will never be reset.
#
# See the comments in the PURGE_DENY section (above)
# for details on specifying this value or for complete details
# refer to:  http://denyhosts.sourceforge.net/faq.html#timespec
#
AGE_RESET_RESTRICTED=25d
#
######################################################################

######################################################################
#
# AGE_RESET_INVALID: Specifies the period of time between failed login
# attempts that, when exceeded will result in the failed count for
# this host to be reset to 0.  This value applies to login attempts
# made to any invalid username (those that do not appear
# in /etc/passwd).  If not defined, count will never be reset.
#
# See the comments in the PURGE_DENY section (above)
# for details on specifying this value or for complete details
# refer to:  http://denyhosts.sourceforge.net/faq.html#timespec
#
AGE_RESET_INVALID=10d
#
######################################################################

######################################################################
#
# RESET_ON_SUCCESS: If this parameter is set to "yes" then the
# failed count for the respective ip address will be reset to 0
# if the login is successful.
#
# The default is RESET_ON_SUCCESS = no
#
#RESET_ON_SUCCESS = yes
#
#####################################################################

######################################################################
#
# PLUGIN_DENY: If set, this value should point to an executable
# program that will be invoked when a host is added to the
# HOSTS_DENY file.  This executable will be passed the host
# that will be added as its only argument.
#
#PLUGIN_DENY=/usr/bin/true
#
######################################################################

######################################################################
#
# PLUGIN_PURGE: If set, this value should point to an executable
# program that will be invoked when a host is removed from the
# HOSTS_DENY file.  This executable will be passed the host
# that is to be purged as its only argument.
#
#PLUGIN_PURGE=/usr/bin/true
#
######################################################################

######################################################################
#
# USERDEF_FAILED_ENTRY_REGEX: if set, this value should contain
# a regular expression that can be used to identify additional
# hackers for your particular ssh configuration.  This functionality
# extends the built-in regular expressions that DenyHosts uses.
# This parameter can be specified multiple times.
# See this faq entry for more details:
#    http://denyhosts.sf.net/faq.html#userdef_regex
#
#USERDEF_FAILED_ENTRY_REGEX=
#
#
######################################################################

   ######### THESE SETTINGS ARE SPECIFIC TO DAEMON MODE  ##########

#######################################################################
#
# DAEMON_LOG: when DenyHosts is run in daemon mode (--daemon flag)
# this is the logfile that DenyHosts uses to report its status.
# To disable logging, leave blank.  (default is: /var/log/denyhosts)
#
DAEMON_LOG = /var/log/denyhosts
#
# disable logging:
#DAEMON_LOG =
#
######################################################################

#######################################################################
#
# DAEMON_LOG_TIME_FORMAT: when DenyHosts is run in daemon mode
# (--daemon flag) this specifies the timestamp format of
# the DAEMON_LOG messages (default is the ISO8061 format:
# ie. 2005-07-22 10:38:01,745)
#
# for possible values for this parameter refer to: man strftime
#
# Jan 1 13:05:59
#DAEMON_LOG_TIME_FORMAT = %b %d %H:%M:%S
#
# Jan 1 01:05:59
#DAEMON_LOG_TIME_FORMAT = %b %d %I:%M:%S
#
###################################################################### 

#######################################################################
#
# DAEMON_LOG_MESSAGE_FORMAT: when DenyHosts is run in daemon mode
# (--daemon flag) this specifies the message format of each logged
# entry.  By default the following format is used:
#
# %(asctime)s - %(name)-12s: %(levelname)-8s %(message)s
#
# Where the "%(asctime)s" portion is expanded to the format
# defined by DAEMON_LOG_TIME_FORMAT
#
# This string is passed to python's logging.Formatter contstuctor.
# For details on the possible format types please refer to:
# http://docs.python.org/lib/node357.html
#
# This is the default:
#DAEMON_LOG_MESSAGE_FORMAT = %(asctime)s - %(name)-12s: %(levelname)-8s %(message)s
#
#
###################################################################### 

#######################################################################
#
# DAEMON_SLEEP: when DenyHosts is run in daemon mode (--daemon flag)
# this is the amount of time DenyHosts will sleep between polling
# the SECURE_LOG.  See the comments in the PURGE_DENY section (above)
# for details on specifying this value or for complete details
# refer to:    http://denyhosts.sourceforge.net/faq.html#timespec
#
#
DAEMON_SLEEP = 30s
#
#######################################################################

#######################################################################
#
# DAEMON_PURGE: How often should DenyHosts, when run in daemon mode,
# run the purge mechanism to expire old entries in HOSTS_DENY
# This has no effect if PURGE_DENY is blank.
#
DAEMON_PURGE = 1h
#
#######################################################################

   #########   THESE SETTINGS ARE SPECIFIC TO     ##########
   #########       DAEMON SYNCHRONIZATION         ##########

#######################################################################
#
# Synchronization mode allows the DenyHosts daemon the ability
# to periodically send and receive denied host data such that
# DenyHosts daemons worldwide can automatically inform one
# another regarding banned hosts.   This mode is disabled by
# default, you must uncomment SYNC_SERVER to enable this mode.
#
# for more information, please refer to:
#        http:/denyhosts.sourceforge.net/faq.html#sync
#
#######################################################################

#######################################################################
#
# SYNC_SERVER: The central server that communicates with DenyHost
# daemons.  Currently, denyhosts.net is the only available server
# however, in the future, it may be possible for organizations to
# install their own server for internal network synchronization
#
# To disable synchronization (the default), do nothing.
#
# To enable synchronization, you must uncomment the following line:
#SYNC_SERVER = http://xmlrpc.denyhosts.net:9911
#
#######################################################################

#######################################################################
#
# SYNC_INTERVAL: the interval of time to perform synchronizations if
# SYNC_SERVER has been uncommented.  The default is 1 hour.
#
#SYNC_INTERVAL = 1h
#
#######################################################################

#######################################################################
#
# SYNC_UPLOAD: allow your DenyHosts daemon to transmit hosts that have
# been denied?  This option only applies if SYNC_SERVER has
# been uncommented.
# The default is SYNC_UPLOAD = yes
#
#SYNC_UPLOAD = no
#SYNC_UPLOAD = yes
#
#######################################################################

#######################################################################
#
# SYNC_DOWNLOAD: allow your DenyHosts daemon to receive hosts that have
# been denied by others?  This option only applies if SYNC_SERVER has
# been uncommented.
# The default is SYNC_DOWNLOAD = yes
#
#SYNC_DOWNLOAD = no
#SYNC_DOWNLOAD = yes
#
#
#
#######################################################################

#######################################################################
#
# SYNC_DOWNLOAD_THRESHOLD: If SYNC_DOWNLOAD is enabled this parameter
# filters the returned hosts to those that have been blocked this many
# times by others.  That is, if set to 1, then if a single DenyHosts
# server has denied an ip address then you will receive the denied host.
#
# See also SYNC_DOWNLOAD_RESILIENCY
#
#SYNC_DOWNLOAD_THRESHOLD = 10
#
# The default is SYNC_DOWNLOAD_THRESHOLD = 3
#
#SYNC_DOWNLOAD_THRESHOLD = 3
#
#######################################################################

#######################################################################
#
# SYNC_DOWNLOAD_RESILIENCY:  If SYNC_DOWNLOAD is enabled then the
# value specified for this option limits the downloaded data
# to this resiliency period or greater.
#
# Resiliency is defined as the timespan between a hackers first known
# attack and its most recent attack.  Example:
#
# If the centralized   denyhosts.net server records an attack at 2 PM
# and then again at 5 PM, specifying a SYNC_DOWNLOAD_RESILIENCY = 4h
# will not download this ip address.
#
# However, if the attacker is recorded again at 6:15 PM then the
# ip address will be downloaded by your DenyHosts instance.
#
# This value is used in conjunction with the SYNC_DOWNLOAD_THRESHOLD
# and only hosts that satisfy both values will be downloaded.
# This value has no effect if SYNC_DOWNLOAD_THRESHOLD = 1
#
# The default is SYNC_DOWNLOAD_RESILIENCY = 5h (5 hours)
#
# Only obtain hackers that have been at it for 2 days or more:
#SYNC_DOWNLOAD_RESILIENCY = 2d
#
# Only obtain hackers that have been at it for 5 hours or more:
#SYNC_DOWNLOAD_RESILIENCY = 5h
#
#######################################################################

Este archivo como puedes ver, tiene varias posibilidades de configuración, una de las más importantes a mi juicio son las siguientes:

* DENY_THRESHOLD_INVALID: Número de intentos no válidos con usuario inexistente, necesarios para banear la IP.
* DENY_THRESHOLD_VALID: Número de intentos no válidos con un usuario existente, necesarios para banear la IP.
* DENY_THRESHOLD_ROOT: Número de intentos no válidos, al intentar entrar como root, necesarios para banear la IP.
* BLOCK_SERVICE = sshd/ALL/etc… : Directiva que indica los servicios que bloqueará a los usuarios baneados.
* DAEMON_LOG = /var/log/denyhosts : Indica el archivo en el que se guardarán los logs de denyhosts.

Una vez configurado el archivo precedente, debemos crear dos archivos dentro del directorio /etc

$ sudo touch /etc/hosts.allow
$ sudo touch /etc/hosts.deny

Luego arrancamos denyhosts

$ sudo /etc/init.d/denyhosts start

Share

Posteado en Software | Sin Comentarios »