If you arrive on this page, is that you have already received a DDoS attack on your server or you want to protect it before this attack happens on your server.
In this tutorial, we will install « No More DDoS » (replacing DDoS Deflate that is no longer maintained by its author) that lets you easily protect you against small DDoS attacks.
This script is available in 2 versions :
- the Debian version, compatible with : Debian 6/7/8, Ubuntu Server 13.10, Ubuntu Server 14.04, Linux Mint 17 and distributions based on Debian.
- the CentOs version, compatible with : CentOs 6/7, RHEL 6/7 (à venir dans la version 2.0), Fedora 20 (coming in version 2.0), and distributions based on CentOs.
- Install No More DDoS
- Configure No More DDoS
- No More DDoS GUI
- Update No More DDoS
- Uninstall No More DDoS
1. Install No More DDoS
To install « No More DDoS for Debian« , use the following command :
wget -O- https://raw.githubusercontent.com/stylersnico/nmd/master/debian/install.sh | sh
To install »No More DDoS for CentOS 7 » use the following command :
wget -O- https://raw.githubusercontent.com/stylersnico/nmd/master/centos/install.sh | sh
2. Configurer No More DDoS
To configure No More DDoS, edit the « /usr/local/nmd/conf.d/agent.conf » file :
vim /usr/local/nmd/conf.d/agent.conf
In this file, you can edit the following information :
FREQ : Interval time between 2 launches of the script. By default, this script is run once per minute.
NO_OF_CONNECTIONS : Corresponds to the maximum number of established connections to an IP address. If an IP address has more than 500 connections established on your server, this IP will be banned.
APF_BAN : By default, the script blocks IP addresses in the firewall with iptables (APF_BAN=0). To use « APF », specify 1 (APF_BAN=1).
EMAIL_TO : If you wish to be notified when blocking a DDoS attack, enter your email address at this line. If you leave this empty, then, no e-mail will be sent.
BAN_PERIOD : Period during an IP address is blocked. Default : 3600 seconds = 1 hour.
Lire la suite…
Source: nixCraft
I am a new Debian Linux v.7.x / Ubuntu Linux LTS user. How do I reinstall a package using apt-get command line?
The Advanced Packaging Tool (APT) works on both Debian / Ubuntu and it can handle the installation and removal of software. You need use apt-get command as follows to forcefully reinstall package. The syntax is:
apt-get --reinstall install PackageNameHere
OR
apt-get --reinstall install Package1 Package2
The --reinstall option re-install packages that are already installed and at the newest version.
Pro tip: Backup configuration files before you reinstall packages. For example, if you are reinstalling nginx web server package, backup /etc/nginx/ with cp command i.e. mkdir /root/nginx.mmddyyyy/; cp -avr /etc/nginx/* /root/nginx.mmddyyy/
Examples
The following command will reinstall rsync package. Open a terminal and then type:
$ sudo apt-get --reinstall install rsync
OR
# apt-get --reinstall install rsync
Sample outputs:

Fig.01: Debian / Ubuntu Linux reinstall a package using apt-get command
If above method failed for you, try the following syntax. Make sure you backup config file before typing the following commands. Please note that the --purge option is identical to remove except that packages are removed and purged including any configuration files are deleted too.
sudo apt-get --purge remove package1
sudo apt-get install package1
Source: nixCraft
Both Debian and Ubuntu Linux provides a number of package management tools. This article summaries package management command along with it usage and examples for you.
apt-get : APT is acronym for Advanced Package Tool. It supports installing packages over internet using ftp or http protocols. You can also upgrade all packages in a single operations, which makes it even more attractive.
dpkg : Debian packaging tool which can be use to install, query, uninstall packages.
Gui tools: You can also try GUI based or high level interface to the Debian GNU/Linux package system. Following list summaries them:
aptitude: It is a text-based interface to the Debian GNU/Linux package system.
synaptic: GUI front end for APT
Red hat Linux package names generally end in .rpm, similarly Debian package names end in .deb, for example:
apache_1.3.31-6_i386.deb
Where,
apache : Package name
1.3.31-6 : Version number
i386 : Hardware Platform on which this package will run (i386 == intel x86 based system)
.deb : Extension that suggest it is a Debian package
Remember, whenever I refer .deb file it signifies complete file name, and whenever I refer package name it must be first part of .deb file. For example, when I refer to a package sudo it means sudo only and not the .deb file i.e. sudo_1.6.7p5-2_i386.deb. You can find out debian package name with the following command:
apt-cache search {package-name}
apt-cache search apache
Finally, most of the actions listed in this post are written with the assumption that they will be executed by the root user running the bash or any other modern shell. Lire la suite…
Source: nixCraft
I setup a web-server. I need to grant a user ssh access but I do not trust users. How can I limit user session to a specific directory such as /home/httpd/$USERNAME? How do I set up a ssh chroort jail on a Linux operating systems?
You can interactive shell with special root directory on a Linux or Unix-like systems. You can set the pathname (such as /home/httpd/foo) of a directory to chroot to after authentication. All components of the pathname must be root owned directories that are not writable by any other user or group. After the chroot, sshd changes the working directory to the user’s home directory.
Say hello to ChrootDirectory directive
From the sshd_config man page:
The ChrootDirectory must contain the necessary files and directo ries to support the user’s session. For an interactive session this requires at least a shell, typically sh(1), and basic /dev nodes such as null(4), zero(4), stdin(4), stdout(4), stderr(4), arandom(4) and tty(4) devices. For file transfer sessions using « sftp », no additional configuration of the environment is necessary if the in-process sftp server is used, though sessions which use logging do require /dev/log inside the chroot directory.
Lire la suite…
Qu’est-ce que c’est?
IPTables regroupe les lignes de commandes nécessaires à la gestion de Netfilter. Oui mais que fait Netfilter ? Pour les anglophones, vous aurez remarquer que dans Netfilter, il y a Net et il y a Filter donc à priori ça va parler d’Internet et de filtrage. Et qui dit filtrage, veut dire Firewall.
Voilà le mot est laché ! Le couple Netfilter/IPTables permet de faire du filtrage de port grâce à des règles de pare-feu. Il sera alors possible de bloquer certains paquets IP et de laisser passer ceux qui nous intéressent. Par exemple par le port 80 (le port pour http), le trafic Internet sera possible et votre navigateur préféré vous emmènera sur les autoroutes du savoir offert par Internet. Lire la suite…