giovedì 31 ottobre 2013

fail2ban: proteggere saslauthd

Debian 6.0.8
fail2ban 0.8.4-3+squeeze2
Debian 5.0.10
fail2ban 0.8.3-2sid1

failregex = (?i): warning: [-._\w]+\[\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed(: [A-Za-z0-9+]*)?

Debian 5.0.10
fail2ban 0.8.3-2sid1

failregex = : warning: [-._\w]+\[\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed



mercoledì 30 ottobre 2013

postfix: attivare debug connessione con un mail server

Se vogliamo verificare come mai il mail server del dominio dominio.ext rifiuta le email dal nostro server possiamo attivare il debug specifico per quel dominio:
postconf -e debug_peer_list=dominio.ext
postconf -e debug_peer_level=3
postfix reload

Backuppc: cambiare la password dell'utente sull'interfaccia grafica

htpasswd /etc/backuppc/htpasswd $NOME_UTENTE

Backuppc: escludere directory su copia rsync

$Conf{RsyncShareName} = [
  '/home/user',
  '/etc',
  '/usr/local/bin'
];

$Conf{BackupFilesExclude} = {
  '/home/user' => [
    '/NOBACKUP/**',
    '/Music/**',
    '/Videos/**',
    '/.aMule/**'
  ]
};

mercoledì 23 ottobre 2013

PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings.


Questo errore nei log di Apache:
FastCGI: server "/var/www/clients/client3/web4/cgi-bin/php5-fcgi-*-80-example.com" stderr: PHP message: PHP Warning:  strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.
e' caratteristico di PHP 5.3 (pare sia sparito con la release 5.4).
Per risolverlo bisogna aggiungere al php.ini la riga:
date.timezone = "Europe/Rome"
personalizzando se occorre la timezone tra doppi apici

backuppc: ping timeout

La copia di un computer remoto non parte perche' il sistema trova la risposta del ping troppo lenta?
Se sapete cosa state facendo potete aumentare il limite di questo controllo aumentando la configurazione (ad esempio) da:
$Conf{PingMaxMsec} = '10'
a
$Conf{PingMaxMsec} = '500'
Il numero e' espresso in millisecondi

SSH: usare porte diverse dalla 22


Nessun problema utilizzando -p per ssh e -P per scp ma se vogliamo dimenticarci di usarli possiamo editare il file:
~/.ssh/config
e inserire qualcosa del genere
Host my.first.computer
         Port 2222
Host my.second.computer      
         Port 3333
a questo punto possiamo tranquillamente utilizzare il comando:
ssh utente@my.first.computer
o
scp foo utente@my.second.computer:bar
senza bisogno di specificare la porta.