SSH

 

#-------- Fichier sshd
/etc/ssh/sshd_config

#-------- reconduire cle publique sur le distant
cat id_rsa.pub | ssh owner@machine "cat – >> ${path}/authorized_keys"

#-------- Fichier config sur emetteur
Host druonrsa
 HostName 170.247.2.100
 User n-t-92b
 Port 22
 IdentityFile /home/x1co/.ssh/id_rsa
Host druondsa
 HostName 170.247.2.100
 User n-t-92b
 Port 22
 IdentityFile /home/x1co/.ssh/id_dsa

#------- ça permet de faire des appels au distant
ssh druonrsa
ssh druondsa

#---------- Si cet erreur lors de la connection
#----------  mettre StrictModes no dans  /etc/ssh/sshd_config
debug1: Next authentication method: publickey
debug1: Offering public key: /home/x1co/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
n-t-92b@170.247.2.100's password:

  • Encoder un fichier de données avec openssl

openssl enc -e -base64 -in ./temp_$$ -out ./ficcode
  • Décoder ce fichier

openssl enc -d -base64 -in ./ficcode
  • Exemple

user@user:~$ cat temp_$$
#!/bin/sh
#
#=====================================================================
# Pour recuperer code cotation 
# aller sur http://www.boursorama.com/bourse/actions/cours_az.phtml
#  puis selectionner la cotation desiree
# recuperer le lien avec parametres passes
# exemple : AIR lIQUIDE
#  http://www.boursorama.com/cours.phtml?symbole=1rPAI
# mettre dans la variable Actions : 1rPAI#AIR_LIQUIDE
# CQFD
#=====================================================================
#

user@user:~$ cat temp_$$ | openssl enc -e -base64 
IyEvYmluL3NoCiMKIz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQojIFBvdXIgcmVjdXBl
cmVyIGNvZGUgY290YXRpb24gCiMgYWxsZXIgc3VyIGh0dHA6Ly93d3cuYm91cnNv
cmFtYS5jb20vYm91cnNlL2FjdGlvbnMvY291cnNfYXoucGh0bWwKIyAgcHVpcyBz
ZWxlY3Rpb25uZXIgbGEgY290YXRpb24gZGVzaXJlZQojIHJlY3VwZXJlciBsZSBs
aWVuIGF2ZWMgcGFyYW1ldHJlcyBwYXNzZXMKIyBleGVtcGxlIDogQUlSIGxJUVVJ
REUKIyAgaHR0cDovL3d3dy5ib3Vyc29yYW1hLmNvbS9jb3Vycy5waHRtbD9zeW1i
b2xlPTFyUEFJCiMgbWV0dHJlIGRhbnMgbGEgdmFyaWFibGUgQWN0aW9ucyA6IDFy
UEFJI0FJUl9MSVFVSURFCiMgQ1FGRAojPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiMK
Cg==



Previous page: Editeur Vi
Page suivante : SendMail