Mysql: afficher la date du dernier redémarrage

afficher la date du dernier redémarrage, la valeur est donnée en secondes mysql> show status where `variable_name` ='uptime'; +——————+———–+ | Variable_name | Value | +——————+———–+ | Uptime | 2348 | +——————+———–+

Continuer

Ajouter un compte sftp limité à un dossier (gestion par groupe)

-Ajouter le groupe: # groupadd sftp_users -Créer le répertoire d’échange: # mkdir -p /home/repertoire_sftp/user_sftp/upload -Créer l’utilisateur SFTP: # useradd -d /home/repertoire_sftp/user_sftp -g sftp_users -m sftp_user -Ajouter le mot de passe d’utilisateur SFTP: # passwd sftp_user -Ajuster les permissions: # chown -R root:sftp_users /home/repertoire_sftp/ # chmod -R 750 /home/repertoire_sftp # chown sftp_user:sftp_users /home/repertoire_sftp/user_sftp/upload/ # chmod 750 /home/repertoire_sftp/user_sftp/upload/ -Ajouter à la fin du fichier /etc/ssh/sshd_config: Subsystem sftp internal-sftp -f AUTH -l VERBOSE Match Group sftp_users ChrootDirectory /home/repertoire_sftp/%u ForceCommand repertoire_sftp AllowTcpForwarding no GatewayPorts […]

Continuer

vérifier si une adresse ip est blacklistée

#!/bin/sh declare -A blackliste=( ['b.barracudacentral.org']="http://barracudacentral.org/rbl/removal-request" ['bl.spamcannibal.org']="http://spamcannibal.org/cannibal.cgi" ['bl.spamcop.net']="https://www.spamcop.net/bl.shtml" ['cbl.abuseat.org']="https://www.abuseat.org/lookup.cgi" ['dnsbl-1.uceprotect.net']="http://www.uceprotect.net/en/rblcheck.php" ['dnsbl-2.uceprotect.net']="http://www.uceprotect.net/en/rblcheck.php" ['dnsbl-3.uceprotect.net']="http://www.uceprotect.net/en/rblcheck.php" ['dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support" ['dul.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support" ['dyna.spamrats.com']="http://spamrats.com/removal.php" ['http.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support" ['ips.backscatterer.org']="http://www.backscatterer.org/?target=test" ['misc.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support" ['noptr.spamrats.com']="http://spamrats.com/removal.php" ['pbl.spamhaus.org']="https://www.spamhaus.org/pbl/" ['sbl.spamhaus.org']="https://www.spamhaus.org/sbl/" ['smtp.dnsbl.sorbs.net']=”http://www.sorbs.net/cgi-bin/support" ['socks.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support" ['spam.abuse.ch']="https://abuse.ch/" ['spam.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support" ['spam.spamrats.com']="http://spamrats.com/removal.php" ['ubl.lashback.com'’]="https://blacklist.lashback.com/" ['web.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support" ['wormrbl.imp.ch']="http://imp.ch" ['xbl.spamhaus.org']="https://www.spamhaus.org/xbl/" ['zen.spamhaus.org']="https://www.spamhaus.org/zen/" ['zombie.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support") read -p 'Veuillez entrer votre ip: ' ip adip=$ip; if test -n "$adip" then echo -e "\n" if echo "$(host $adip)" | grep found >/dev/null 2>&1; then echo "Aucun reverse DNS disponible, merci de verifier votre adresse IP"; exit 1; else adresseip=`host $adip | awk '{print $1}' | sed […]

Continuer