Connexion SSH avec clé RSA + passphrase

Pour ce connecter de façon vraiment sécurisé à vos serveur, la clé RSA et la passphrase sont un très bon début…

D’abord générer des clés

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/thouveni/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): ***********************************************
Enter same passphrase again: ***********************************************
Your identification has been saved in /home/thouveni/.ssh/id_rsa.
Your public key has been saved in /home/thouveni/.ssh/id_rsa.pub.
The key fingerprint is:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Ensuite diffuser sa clé publique

$ scp ~/.ssh/id_rsa.pub [user@]host:~/.ssh/authorized_keys2
id_rsa.pub 100% 401 0.4KB/s 00:00

OU

cat $HOME/.ssh/id_rsa.pub | ssh [user@]host "mkdir -p .ssh; chmod 700 .ssh; cat >> .ssh/authorized_keys"

OU

ssh-copy-id [user@]host

Enfin tester la connexion :

$ ssh [user@]host
Enter passphrase for key '/home/user/.ssh/identity':

Valider temporairement sa passphrase :

eval 'ssh-agent'
ssh-add ~/.ssh/id_rsa

Modification de votre passphrase :

ssh-keygen -p

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
5c:9b:16:56:a6:cd:11:10:3a:cd:1b:a2:91:cd:e5:1c.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:1
RSA host key for ras.mydomain.com has changed and you have requested strict checking.
Host key verification failed.

Solution :

ssh-keygen -R IP

Cours, apprentissage de la programmation shell

Pendant très longtemps j’ai chercher un site, un cours sur l’apprentissage du shell mais les moteurs de recherches ne me donnant pas pleine satisfaction, ayant toujours soif de plus plus plus de fonctionnalité, de savoir je commençais à désespérer.. jusqu’au jour ou je suis tomber par hasard sur le Guide avancé d’écriture des scripts Bash et la.. j’ai compris que le petit jésus existait… Donc si comme moi vous êtes une feignasse qui veut tous automatiser apprenez le shell

==> http://abs.traduc.org/

Mémo – Couteau suisse linux

htop : Un top mais en mieux (monitoring en temps réel coloré)

clamtk : Scanner les clés USB de vos utilisateurs Windows Clamtk

grep -E -v '^(#|$)' fic.conf : Décommenter un fichier de conf

trickle : Limite la bande passante d’une application!

cp /etc/apache2/apache2.conf{,.bak} Reviens a faire  cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.bak

tsocks : Faire passer le flux réseau dans un proxy socks netcat :

nc pour faire du client / serveur en bash

Perlbrew – Perl indépenant du système

PerlBrew permet d’installer une version de Perl indépendante de celle du système ce qui permet d(éviter les conflits entre les scripts maison et les paquets système.

Avec Perlbrew il est possible d’installer Perl dans le HOME d’un utilisateur ou dans un répertoire type /opt/perl5 (ce que nous avons choisie ici)

Note : cpan fonctionne normalement avec Perlbrew

Installation

Environnement

Par défaut Perlbrew s’installe dans $HOME/perl5, nous souhaitons l’installer dans /opt/perl5, il faut donc lui préciser un autre lieu :

 $ export PERLBREW_ROOT=/opt/perl5</pre>
$ cd /opt/perl5
$ curl -k -LO http://xrl.us/perlbrew
$ perl ./perlbrew install
$ rm ./perlbrew
$ /opt/perl5/bin/perlbrew init

Les commandes suivante vont modifier le PATH afin

 $ echo "export PERLBREW_ROOT=/opt/perl5" >> ~/.bashrc
$ echo "source /opt/perl5/etc/bashrc" | tee -a ~/.bashrc

Déconnectez-vous ou relancer la bash. Vous devriez avoir de nouvelles variables d’environnement :

 $ env | grep PATH
PATH=/opt/perl5/bin:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin:/opt/scala/cur/bin:/usr/local/mysql/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/opt/scala/cur/bin
PERLBREW_PATH=/opt/perl5/bin

Installation de perl

 $ perlbrew mirror
# Choisir par exemple : 78 : OVH
$ perlbrew -v install perl-5.14.2 -Dusethreads

Switch perl

Actuellement sur le système perl v5.8.8

 $ perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
 GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
 this system using "man perl" or "perldoc perl".  If you have access to the
 Internet, point your browser at http://www.perl.org/, the Perl Home Page.

On switch sur l’install de perl 5.14.2

$ perlbrew switch perl-5.14.2
$ perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux

Copyright 1987-2011, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
 GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
 this system using "man perl" or "perldoc perl".  If you have access to the
 Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Retour sur la version système :

 $ perlbrew off
perlbrew is turned off.
$ perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
 GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
 this system using "man perl" or "perldoc perl".  If you have access to the
 Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Perl & le CPAN

Installation de CPAN

 $ perlbrew switch perl-5.14.2
$ cpan
# Answer all setup instructions
» o conf commit
» q

Utilisation CPAN

 $ cpanm --interactive -v App::cpanoutdated

Source

  • http://www.perlbrew.pl/
  • http://blog.fox.geek.nz/2010/09/installing-multiple-perls-with.html
  • http://nxadm.wordpress.com/2010/12/10/get-the-latest-perl-release-with-perlbrew/
  • http://www.perl.org/get.html
  • http://search.cpan.org/~gugod/App-perlbrew-0.39/bin/perlbrew#INSTALLATION

[recette] Pâte tartiner à la noisette (Nutella© maison)

Ingrédients

  • 150 g de beurre salé (aux cristaux de sel)
  • 100 g de chocolat noir
  • 50 g de chocolat au lait
  • 400 g de lait concentré sucré
  • 70 g de noisettes en poudre

Pâte tartiner à la noisette

Faire fondre les chocolats au bain-marie avec le beurre. Hors du feu, ajouter le lait concentré sucré puis mélanger avec les noisettes. Laisser reposer au frigidaire.

Pour les noisettes, il existe des sachets de noisettes en poudre, moi je préfère acheter des noisettes et les écraser… c’est meilleur.
Nestlé fait des boîtes de conserve de 400 g de lait concentré sucré.
Du bon chocolat fait de la bonne pâte à tartiner.

Pour varier

Faites osciller la proportion de chocolat noir/au lait afin d’affiner le goût à vos papilles.

Recette posté par mes soins sur cuisine-libre.fr

En continuant à utiliser le site, vous acceptez l’utilisation des cookies (au chocolat) Plus d’informations

Les cookies sont utilisés à des fin de statistique de visite du blog sur une plateforme indépendante que j'héberge moi même. Les statistiques sot faites avec un logiciel libre. Aucune information n'est redistribué à google ou autre. Je suis seul autorisé à lire ces informations

Fermer