I just had a problem to solve: Compare two server config files on two servers to make sure they’re the same. Rather than using scp to copy the file from one machine to another, I used ssh’s ability to run commands remotely to get the contents of the file and piped it into diff. Here’s an example:
Q. How do I detect port scan attacks by analyzing Debian Linux firewall log files and block port scans in real time? How do I detect suspicious network traffic under Linux?
A. A port scanner (such as nmap) is a piece of software designed to search a network host for open ports. Cracker can use nmap to scan your network before starting attack. You can always see scan patterns by visiting /var/log/messages. But, I recommend the automated tool called psad – the port scan attack detector under Linux which is a collection of lightweight system daemons that run on Linux machines and analyze iptables log messages to detect port scans and other suspicious traffic.
psad makes use of Netfilter log messages to detect, alert, and (optionally) block port scans and other suspect traffic. For tcp scans psad analyzes tcp flags to determine the scan type (syn, fin, xmas, etc.) and corresponding command line options that could be supplied to nmap to generate such a scan. In addition, psad makes use of many tcp, udp, and icmp signatures contained within the Snort intrusion detection system.
Install psad under Debian / Ubuntu Linux
Type the following command to install psad, enter: $ sudo apt-get update $ sudo apt-get install psad
Quand votre nom de domaine pointe vers un hébergement mutualisé, vous n’avez, la plupart du temps, pas le droit de modifier les VirtualHost du serveur Apache.
Virtual Hosts
Pour pallier ce manque, une redirection s’impose mais par un autre biais: l’utilisation de l’URL Rewrting. Lire la suite…
Un jour vous pouvez resté bloqué par un mot de passe perdu pour accéder à Webmin et vous auriez besoin d’un moyen de le changer.
Voici comment: pour commencer, connectez-vous à votre système en ssh.Vous devez trouver où Webmin est installé et donc le chemin que le script utilisera pour réinitialiser le mot de passe. Lire la suite…
Récemment, je me suis aperçu que mon dernier fichier /var/log/auth.log n’avait pas été renouvelé depuis le 17/04/2011… Evidemment, ça n’aide pas à analyser sereinement les fichiers de logs, vu la taille que ça génère: 105306586 c’est-à-dire plus de 100Mo !
Je voulais conserver 26 semaines de logs pour analyser les tentatives d’intrusion et calculer leur évolution au fur et à mesure que je renforçais la protection de mon serveur.
Tout simple:
créer un fichier séparé pour auth.log qu’on appelle /etc/logrotate.d/auth: