Archive

Articles taggués ‘securite’

How to Use RSA Key for SSH Authentication

12/02/2024 Comments off

If your daily activity requires loging in a lot of Linux systems through SSH, you will be happy to know (if you don’t already) that there’s a way to allow secure, authenticated remote access, file transfer, and command execution without having to remember passwords for each individual host you connect.

The $HOME/.ssh/authorized_keys file contains the RSA keys allowed for RSA authentication. Each line contains one key, which consists of the following fields: options, bits, exponent, modulus and comment. The first field is optional, bits, exponent and modulus fields give the RSA key and the last field isn’t used at all in the authentication process, but it will be somewhat convenient to the user, for instance to know which key is for which machine.

Before we start, make sure your computer has a ssh client installed and the remote Linux system has ssh installed and sshd running, with RSA authentication enabled (RSAAuthentication yes in /etc/ssh/sshd_config).

Lire la suite…

Categories: Réseau, Système Tags: , ,

Se logguer à distance avec ssh (Linux)

11/02/2024 Comments off

Source: Comment ça marche

Les commandes suivantes nécessitent d’avoir un compte sur la machine sur laquelle on veut se connecter et qu’un serveur SSH y soit installé.

Sous Linux, la syntaxe est simple (le client étant intégré dans la plupart des distributions) :

Dans un terminal (n’importe lequel), tapez :

ssh login:motDePasse@MachineSurLaquelleJeveuxmeconnecter
ou
login@(machine sur laquelle je veux me connecter )

Dans ce cas-là, si la machine accepte la connexion, le mot de passe vous sera demandé juste après.
Pour se logguer en mode graphique (utiliser un serveur X), il faut utiliser l’option -X.

Utilisation de SSH à travers un proxy

Installez tout d’abord le paquet proxy-connect :

sudo aptitude install proxy-connect

Modifiez le fichier /etc/ssh/ssh_config pour permettre l’utilisation de SSH en passant par le proxy :

sudo echo 'ProxyCommand /usr/bin/connect-proxy -4 -S monproxy.domaine.com:port %h %p' >> /etc/ssh/ssh_config

Veillez à bien remplacer « monproxy.domaine.com » et « port » par le nom de votre proxy et son numéro de port.

How to reset the administrator password in ISPConfig 3 ?

10/02/2024 Comments off

Source: faqforge.com

If you lost your ISPConfig 3 administrator password, you can reset it with the following SQL query.

UPDATE sys_user SET passwort = md5(‘admin’) WHERE username = ‘admin’;

The SQL query sets the password to “admin” for the user “admin”, it has to be executed in the ISPConfig mysql database, e.g. with phpmyadmin. If you dont have phpmyadmin installed, then the query can be executed with the mysql commandline utility as well:

Login to the mysql database.

mysql -u root -p

and enter the password of the mysql root user. To switch to the ISPConfig database, run this command:

use dbispconfig;

Now execute the SQL command:

UPDATE sys_user SET passwort = md5(‘admin’) WHERE username = ‘admin’;

and close the mysql shell:

quit;

Postfix + fail2ban = win

05/02/2024 Comments off
source: http://blog.dp.cx/25/postfix-fail2ban-win

Recently, I had to lease a new server. My old one was ok, but it was 5 years old, and showing it’s age. The most recent bout of problems was due to postfix, and a specific domain that I host mail for.

I had previously set up Policyd in an attempt to stop the influx of spam before it ever hit the server, but it wasn’t doing anything at this point. So approximately 800 messages per minute were getting directly to Postfix, and then running queries against MySQL (I use virtual maps for users, aliases, domains, etc). 99% of these messages were to non-existant users, so Postfix would bounce them. But the little 2.0GHz Celeron couldn’t handle it. The load shot up to 8 for around 3 weeks, and stayed there. I wish the fail2ban idea had come to me sooner… Lire la suite…

Surveillance système des machines sur un réseau avec Munin

04/02/2024 Comments off

I. Introduction

muninMunin est un outil de surveillance basé sur le célèbre RRDTool, permettant de connaître toutes les données systèmes des autres ordinateurs du réseau. Il les présente automatiquement sous forme de graphiques consultables depuis une page web. Par ailleurs, il dispose d’un système de plugins qui le rend simple d’utilisation et très modulaire.

J’ai choisi de le présenter, et non certains de ses concurrents comme Nagios, Cacti ou Zabbix, car il m’a semblé être le plus simple d’utilisation tout en conservant de fortes possibilités d’adaptation.

Un système Munin est composé de :

  • un serveur principal, récupérant les informations
  • un nœud par équipement à surveiller

Il faut signaler qu’avec une telle architecture Munin se différencie de Nagios. Ce dernier préfère en effet centraliser toutes les mesures sur le serveur, ce qui permet de ne rien installer sur les équipements surveillés.

Lire la suite…