HowTo: Uninstall MySQL Server in Ubuntu Linux

22/06/2021 Categories: Bases de données, Tutoriel Tags: , , , Comments off

Source: nixCraft

I‘m a new Ubuntu Linux user and my cloud hosting company installed MySQL server by default. I need to remove it and delete it from my server as I have no use of MySQL server. How can I uninstall MySQL on a Ubuntu based systems?

Typically following Mysql packages are installed on the Debian or Ubuntu Linux systems:

  • mysql-client – The latest version of MySQL database client.
  • mysql-server – The latest version of MySQL database server.
  • mysql-common – MySQL database common files.

How do I uninstall Mysql server?

Just use the apt-get command as follows remove both MySQL server and client in Ubuntu Linux:

sudo apt-get --purge remove mysql-client mysql-server mysql-common
sudo apt-get autoremove

Sample outputs (pay attention to package names):

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.2.0-31-virtual linux-headers-3.2.0-31
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  libdbd-mysql-perl* libmysqlclient18* mysql-client* mysql-client-5.5* mysql-common* mysql-server*
  mysql-server-5.5*
0 upgraded, 0 newly installed, 7 to remove and 0 not upgraded.
After this operation, 67.5 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 105097 files and directories currently installed.)
Removing mysql-server ...
Removing mysql-server-5.5 ...
mysql stop/waiting
Purging configuration files for mysql-server-5.5 ...
Removing mysql-client ...
Removing mysql-client-5.5 ...
Removing libdbd-mysql-perl ...
Removing libmysqlclient18 ...
Purging configuration files for libmysqlclient18 ...
Removing mysql-common ...
Purging configuration files for mysql-common ...
dpkg: warning: while removing mysql-common, directory '/etc/mysql' not empty so not removed.
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

Delete /etc/mysql/ directory using rm command:
$ sudo rm -rf /etc/mysql/

Understanding apt-get command options

  • --purge : Remove given packages and config files.
  • remove : Uninstall packages.
  • autoremove : Force to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.

Debian TARPIT iptables How To

20/06/2021 Categories: Réseau, Sécurité, Tutoriel Tags: , , Comments off

After recently upgrading some of my servers to Debian Wheezy, I noticed the xtables-addons-dkms package is now available. This means you no longer have to build the iptables modules from source to get tarpit support (and more). If you are not sure what the tarpit target is or why you would want to use it, a basic explaination is that you send unwated TCP traffic to the tarpit target with iptables. All connections are accepted and immediatedly switched to the persist state. The remote side stops sending data and asks to continue every 60-240 seconds and attemts to close the connections from the remote side are ignored. The connection will then timeout in 12-24 minutes.

You might want to do this to slow down and even crash port scans (eg. routed unused ip space to a server with these rules in the forward chain in iptables).


To get started, install the xtables-addons-dkms package:

# apt-get install xtables-addons-dkms

Add rules to send traffic to the tarpit target to suite your needs. Some examples are:

  • Server does not host MSSQL or MySQL database, tarpit those ports:
    iptables -A INPUT -p tcp --dport mysql -j TARPIT
    iptables -A INPUT -p tcp --dport ms-sql-s -j TARPIT
  • Tarpit all TCP connections incoming from the IP address 123.123.123.123:
    iptables -A INPUT -p tcp -s 123.123.123.123 -j TARPIT
  • Tarpit all ports, this would be used as the last rule in an existing firewall in place of a reject/drop rule. If you do not have a reject/drop rule do not use this rule unless you know what you are doing.
    iptables -A INPUT -p tcp -j TARPIT

To test that the above rules are working you can telnet to the host on a port that should go to the tarpit. If the connection works and your connection does not get closed within a few minutes it is working.

As an example of the effect this has on a port scan, I ran nmap on the host before and after. The results speak for themselves:

Before:

After:

Routers between you and the attacker may have issues due to the large amount of connections that will be held open, so make sure you gear can handle it before you try this (the nmap scan as above had a constant 500+ connections open for the tarpit scan alone). This can be an issue if you have a large range routed to the server doing the tarpit.

Source: sysadminblog.net

HowTo Disable The Iptables Firewall in Linux

12/06/2021 Categories: Réseau, Sécurité, Tutoriel Tags: , Comments off

Source: nixCraft

I need to disable firewall in Linux for testing purpose. I’m using CentOS and RHEL version 4.4 / 5 / 6. How do I disable the firewall in Linux?

A Linux firewall is software based firewall that provides protection between your server (workstation) and damaging content on the Internet or network. It will try to guard your computer against both malicious users and software such as viruses/worms.

Task: Disable / Turn off Linux Firewall (Red hat/CentOS/Fedora Core)

Type the following two commands (you must login as the root user):
# /etc/init.d/iptables save
# /etc/init.d/iptables stop

Turn off firewall on boot:
# chkconfig iptables off

Task: Enable / Turn on Linux Firewall (Red hat/CentOS/Fedora Core)

Type the following command to turn on iptables firewall:
# /etc/init.d/iptables start
Turn on firewall on boot:
# chkconfig iptables on

Lire la suite…

HowTo: Linux Check Password Strength With Cracklib-check Command

06/06/2021 Categories: Système, Tutoriel Tags: , , , , Comments off

check password strengthUsing the same password on different servers allows attackers to access your accounts if cracker manage to steal your password from a less secure server. This is true for online website accounts too. So solution is to create unique passwords for server accounts like your email, sftp and ssh accounts. General guideline to create a strong and unique password is as follows:

Creating a strong and unique password for Linux or Unix-like systems

  1. Create a password with mix of numbers, special symbols, and alphabets.
  2. Make sure your password is hard to guess. You can use tool such as makepasswd to create hard to guess password.
  3. Do not use simple words like « password« , « 123456« , « 123abc » or « qwerty« .
  4. Use a unique password for all your server accounts.
  5. A minimum password length of 12 to 14 characters should be used. See how to configure CentOS / RHEL / Fedora Linux based server password quality requirements.
  6. Generating passwords randomly where feasible. You can do this with a simple shell scriptfunction.
  7. If possible use two-factor authentication.
  8. Use pam_crack to ensure strong passwords and to check passwords against a dictionary attack.

But, how do you test the effectiveness of a password in resisting guessing and brute-force attacks under Linux? The answer is simple use cracklib-check command.

Install cracklib on a Linux based system

Type the following yum command to install on RHEL and friends:
# yum install cracklib

Type the following apt-get command to install on Debian/Ubuntu and friends:
# apt-get install libcrack2

Lire la suite…

Installation et configuration d’Observium sous debian / ubuntu

03/06/2021 Categories: Logiciel, Tutoriel Tags: , , , Comments off

Source: NooBUNBOX

Observium est un système de supervision de réseaux basé sur PHP / MySQL. Il supporte une large gamme de distributions (Windows, Linux, FreeBS, ESXI, etc.) et de matériels (Cisco, Linksys, Juniper, Dell).

Observium se décline en deux versions :

  • Observium Community Edition : une version gratuite, open-source et mise à jour tous les 6 mois.
  • Observium Profesionnal : une version payante (£150/an) distribuée via svn patchée quotidiennement (bug fixes, mises à jour de sécurité et nouvelles features)

Pour une utilisation non-professionnelle la version Community Edition suffit. Ici nous allons nous intéreser à l’installation et la configuration d’Observium sous debian 7.

Installation d’Observium

Ici nous partons d’une distribution propre, il nous faut donc commencer par installer les dépendances

sudo apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-json php-pear snmp fping \
mysql-server mysql-client python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick

Créez le répertoire ou nous installerons Observium

Téléchargez la dernière version du logiciel et extrayez la

Lire la suite…