IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Shell et commandes GNU Discussion :

Partage de clé SSH


Sujet :

Shell et commandes GNU

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut Partage de clé SSH
    Bonjour,

    Après avoir lu pas mal de sujet la dessus, je coince je coince

    J'ai un serveur A et un Serveur B, je veux me connecter au serveur B depuis A en ssh d'un coté comme de l'autre.

    Voila le code tapé

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    Serveur A
     
    cd ~/.ssh/
     
    ssh-keygen -f  ~/.ssh/identity -t rsa
    scp identity.pub serveur B:.ssh
     
    ssh Serveur B
    cd ~/.ssh/
    cat identity.pub >> authorized.keys
    chmod 640 authorized.keys
     
    Serveur B
     
    cd ~/.ssh/
     
    ssh-keygen -f  ~/.ssh/identity -t rsa
    scp identity.pub serveur A:.ssh
     
    ssh Serveur A
    cd ~/.ssh/
    cat identity.pub >> authorized.keys
    chmod 640 authorized.keys
    Mais je dois toujours mettre mon code pour me connecter

    les droits de authorized.keys et .ssh sur le serveur B et A
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    -rw-r----- 1 root root  407 jan  9 02:25 authorized.keys
     
    drwxr-xr-x  2 root   root    4096 jan  9 02:26 .ssh
    Merci de votre aide

  2. #2
    Membre Expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Octobre 2008
    Messages
    1 515
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Octobre 2008
    Messages : 1 515
    Par défaut
    Pour du ssh version 2, ta clé privée doit être appelée "~/.ssh/id_rsa" et ta clée plublique doit être appelée "~/.ssh/id_rsa.pub". identity.pub, c'est pour la version 1 du protocole. Bref, il ne faut pas utiliser le -f de ssh-keygen.

    Et puis ça n'a rien à voir avec ton problème, mais ta façon de faire est dangereuse puisque tu écrases le identity.pub de ta machine A avec celui de ta machine B. Donc tu as perdu la clée publique de ta machine A.

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    Mais le identity.pub ne sert plus a rien apres la relation se fait entre authorized.key et identity ou id_rsa.

    Bref

    Le problème est résolu en partie sur mes 2 serveurs test.

    En faite si je met le nom d'hote genre ssh nom il me demande le password
    si je met ssh 10.0.0.0 la ça marche

    alors pourquoi?????

  4. #4
    Membre Expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Octobre 2008
    Messages
    1 515
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Octobre 2008
    Messages : 1 515
    Par défaut
    Regarde dans tes authorized_keys ce que tu as à la fin de tes clées. Normalement tu devrais avoir user@host.domain.dtd (un fully qualified host name, quoi). Peut-être que tu as un nom sans domaine, voire une IP ?

    Vérifie aussi (avec la commande host <IP>) que tes machines savent résoudre l'IP de l'autre machine en un nom pleinement qualifé.

    Pour ton identity.pub écrasé... Le problème c'est que si tu ne l'as plus tu ne peux donner l'accès à d'autres machines, sauf à aller le repécher dans les authorized_keys qui trainent sur tes machines qui ont encore l'accès... Le fichier .pub il faut le garder aussi longtemp que ta clé privée.

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    oki pour l'identity

    Bon concernant mon problème au début j'étais en root quand j'ai fais la manip.

    Donc la j'ai créé des utilisateurs bobo sur mon serveur pegase et sur mon serveur titeuf

    Quand je suis sur titeuf je tape host 10.3.3.4(ip pegase)

    4.3.3.10.in-addr.arpa domain name pointer pegase.xxx.org.

    Quand je suis sur pegase je tape host 10.3.3.6 (ip titeuf)

    6.3.3.10.in-addr.arpa domain name pointer titeuf.xxx.org.


    Par contre si je suis sur pegase je fais ssh bobo@titeuf je me connecte a titeuf

    Mais de titeuf a pegase ça ne va pas.

    Je précise que ceci est sans le partage de clé je rentre le mot de passe a chaque fois et déjà la ça coince

    Je n'ai pas de message d'erreur c'est comme ci je me connecté une 2eme fois a titeuf car si je fais exit je retombe sur titeuf, je ne comprend vraiment pas

    Une idée?

  6. #6
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    [QUOTE=SanTa62;3922912]oki pour l'identity

    Bon concernant mon problème au début j'étais en root quand j'ai fais la manip.

    Donc la j'ai créé des utilisateurs bobo sur mon serveur pegase et sur mon serveur titeuf

    Quand je suis sur titeuf je tape host 10.3.3.4(ip pegase)

    4.3.3.10.in-addr.arpa domain name pointer pegase.xxx.org.

    Quand je suis sur pegase je tape host 10.3.3.6 (ip titeuf)

    6.3.3.10.in-addr.arpa domain name pointer titeuf.xxx.org.

    je test je t'informes au plus vite

  7. #7
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
     
     
    Serveur pegase
     
    cd ~/.ssh/
     
    ssh-keygen  -t rsa
    scp id_rsa.pub bobo@titeuf:.ssh
     
    ssh bobo@titeuf
    cd ~/.ssh/
    cat id_rsa.pub >> authorized.keys
    chmod 640 authorized.keys
     
    Serveur titeuf
     
     
    cd ~/.ssh/
     
    ssh-keygen  -t rsa
    scp id_rsa.pub bobo@pegase:.ssh
     
    ssh bobo@pegase
    cd ~/.ssh/
    cat id_rsa.pub >> authorized.keys
    chmod 640 authorized.keys
    Et la impossible dans les 2 sens en root pas de soucis mais avec un compte utilisateur je ne peux pas

    Helppppp!!!




    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    [boris@titeuf .ssh]$ ssh -vvv boris@pegase
    OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to pegase [10.3.3.4] port 22.
    debug1: Connection established.
    debug1: identity file /home/boris/.ssh/identity type -1
    debug1: identity file /home/boris/.ssh/id_rsa type -1
    debug1: identity file /home/boris/.ssh/id_dsa type -1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
    debug1: match: OpenSSH_4.3 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_4.3
    debug2: fd 3 setting O_NONBLOCK
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-gro                                             up14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour1                                             28,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-c                                             tr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour1                                             28,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-c                                             tr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open                                             ssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open                                             ssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-gro                                             up14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour1                                             28,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-c                                             tr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour1                                             28,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-c                                             tr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open                                             ssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open                                             ssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_init: found hmac-md5
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug2: mac_init: found hmac-md5
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    debug2: dh_gen_key: priv key bits set: 128/256
    debug2: bits set: 514/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: check_host_in_hostfile: filename /home/boris/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug3: check_host_in_hostfile: filename /home/boris/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug1: Host 'pegase' is known and matches the RSA host key.
    debug1: Found key in /home/boris/.ssh/known_hosts:1
    debug2: bits set: 492/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/boris/.ssh/identity ((nil))
    debug2: key: /home/boris/.ssh/id_rsa ((nil))
    debug2: key: /home/boris/.ssh/id_dsa ((nil))
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug3: start over, passed a different list publickey,gssapi-with-mic,password
    debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
    debug3: authmethod_lookup gssapi-with-mic
    debug3: remaining preferred: publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-with-mic
    debug1: Next authentication method: gssapi-with-mic
    debug3: Trying to reverse map address 10.3.3.4.
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Unknown code krb5 195
     
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Unknown code krb5 195
     
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Unknown code krb5 195
     
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/boris/.ssh/identity
    debug3: no such identity: /home/boris/.ssh/identity
    debug1: Trying private key: /home/boris/.ssh/id_rsa
    debug3: no such identity: /home/boris/.ssh/id_rsa
    debug1: Trying private key: /home/boris/.ssh/id_dsa
    debug3: no such identity: /home/boris/.ssh/id_dsa
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup password
    debug3: remaining preferred: ,password
    debug3: authmethod_is_enabled password
    debug1: Next authentication method: password


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    [boris@pegase .ssh]$ ssh -vvv boris@titeuf
    OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to titeuf [10.3.3.6] port 22.
    debug1: Connection established.
    debug1: identity file /home/boris/.ssh/identity type 0
    debug1: identity file /home/boris/.ssh/id_rsa type -1
    debug1: identity file /home/boris/.ssh/id_dsa type -1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
    debug1: match: OpenSSH_4.3 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_4.3
    debug2: fd 3 setting O_NONBLOCK
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_init: found hmac-md5
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug2: mac_init: found hmac-md5
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    debug2: dh_gen_key: priv key bits set: 120/256
    debug2: bits set: 500/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: check_host_in_hostfile: filename /home/boris/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug3: check_host_in_hostfile: filename /home/boris/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug1: Host 'titeuf' is known and matches the RSA host key.
    debug1: Found key in /home/boris/.ssh/known_hosts:1
    debug2: bits set: 540/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/boris/.ssh/id_rsa ((nil))
    debug2: key: /home/boris/.ssh/id_dsa ((nil))
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug3: start over, passed a different list publickey,gssapi-with-mic,password
    debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
    debug3: authmethod_lookup gssapi-with-mic
    debug3: remaining preferred: publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-with-mic
    debug1: Next authentication method: gssapi-with-mic
    debug3: Trying to reverse map address 10.3.3.6.
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Unknown code krb5 195
     
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Unknown code krb5 195
     
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Unknown code krb5 195
     
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/boris/.ssh/id_rsa
    debug3: no such identity: /home/boris/.ssh/id_rsa
    debug1: Trying private key: /home/boris/.ssh/id_dsa
    debug3: no such identity: /home/boris/.ssh/id_dsa
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup password
    debug3: remaining preferred: ,password
    debug3: authmethod_is_enabled password
    debug1: Next authentication method: password

  8. #8
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    Résolu sur mes serveurs de test pegase et titeuf , je me suis trompé dans le nom authorized_keys j'avais mis authorized.keys

    Je te tiens au courant pour mes serveurs de production ou la je peux aller qu dans un sens

  9. #9
    Membre émérite Avatar de jmelyn
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Septembre 2007
    Messages
    703
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux

    Informations forums :
    Inscription : Septembre 2007
    Messages : 703
    Par défaut
    Bonjour,

    Je jongle beaucoup avec SSH (centaines de machines au travail, quelques unes à la maison). Et j'arrive très bien à m'en sortir. Mais il y a beaucoup de paramètres à prendre en compte.

    • La home-dir des utilisateurs est-elle locale à chaque machine ou bien il y a un serveur genre Samba ou AFS?
    • Il n'y a besoin de créer les clés SSH qu'une seule fois, ensuite il suffit de copier la clé privée (par scp, c'est très important pour la sécurité) sur chaque machine, dans le cas de home-dir locales.
    • Les droits, c'est important: le répertoire $HOME/.ssh doit avoir les droits drwx------, c'est-à-dire droits uniquement pour l'utilisateur. Idem pour les clés privées (sauf le d, bien sûr). Les clés publiques peuvent être lues par les autres: -rw-r--r--. Lors de la copie par scp, l'option -p préserve les droits.
    • À force d'essayer, le fichier authorized_keys est rempli par les essais précédents. Il faut enlever les vieilles clés.
    • Il y a aussi les réglages de ssh dans les deux fichiers /etc/ssh/ssh_config (client) et /etc/ssh/sshd_config (serveur). Là, c'est un peu plus technique, il faut lire la man page.
    • Enfin, pour débugger, il y a l'option -vvv de la commande ssh. Cela permet de voir le déroulement de la commande et pourquoi une clé est refusée. Puisqu'un côté fonctionne bien, c'est facile de comparer les deux sorties et de poser ici une question précise.

    Bon courage, avec de la méthode c'est faisable!

  10. #10
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    Pour les droits c'est ok

    Ensuite a chaque test je supprime authorizd_keys ainsi que tous les autres fichiers pour être sure

    Mon serveur horton se connecte en ssh sur mon serveur noddy par contre le contraire non

    Voici le detail

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    [applprod@horton .ssh]$ ssh -vvv applprod@noddy
    OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to noddy [10.x.x.x] port 22.
    debug1: Connection established.
    debug1: identity file /home/applprod/.ssh/identity type -1
    debug3: Not a RSA1 key file /home/applprod/.ssh/id_rsa.
    debug2: key_type_from_name: unknown key type '-----BEGIN'
    debug3: key_read: missing keytype
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug2: key_type_from_name: unknown key type '-----END'
    debug3: key_read: missing keytype
    debug1: identity file /home/applprod/.ssh/id_rsa type 1
    debug1: identity file /home/applprod/.ssh/id_dsa type -1
    debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
    debug1: match: OpenSSH_3.9p1 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_3.9p1
    debug2: fd 3 setting O_NONBLOCK
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_init: found hmac-md5
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug2: mac_init: found hmac-md5
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    debug2: dh_gen_key: priv key bits set: 135/256
    debug2: bits set: 513/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: check_host_in_hostfile: filename /home/applprod/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug3: check_host_in_hostfile: filename /home/applprod/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug1: Host 'noddy' is known and matches the RSA host key.
    debug1: Found key in /home/applprod/.ssh/known_hosts:1
    debug2: bits set: 521/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/applprod/.ssh/identity ((nil))
    debug2: key: /home/applprod/.ssh/id_rsa (0x9d23668)
    debug2: key: /home/applprod/.ssh/id_dsa ((nil))
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug3: start over, passed a different list publickey,gssapi-with-mic,password
    debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
    debug3: authmethod_lookup gssapi-with-mic
    debug3: remaining preferred: publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-with-mic
    debug1: Next authentication method: gssapi-with-mic
    debug3: Trying to reverse map address 10.xx.xx.xx.
    debug2: we sent a gssapi-with-mic packet, wait for reply
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug2: we sent a gssapi-with-mic packet, wait for reply
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/applprod/.ssh/identity
    debug3: no such identity: /home/applprod/.ssh/identity
    debug1: Offering public key: /home/applprod/.ssh/id_rsa
    debug3: send_pubkey_test
    debug2: we sent a publickey packet, wait for reply
    debug1: Server accepts key: pkalg ssh-rsa blen 149
    debug2: input_userauth_pk_ok: fp 02:04:99:05:dd:cb:af:ed:f0:ac:b7:aa:75:97:30:e4
    debug3: sign_and_send_pubkey
    debug1: read PEM private key done: type RSA
    debug1: Authentication succeeded (publickey).
    debug1: channel 0: new [client-session]
    debug3: ssh_session2_open: channel_new: 0
    debug2: channel 0: send open
    debug1: Entering interactive session.
    debug2: callback start
    debug2: client_session2_setup: id 0
    debug2: channel 0: request pty-req confirm 0
    debug3: tty_make_modes: ospeed 38400
    debug3: tty_make_modes: ispeed 38400
    debug3: tty_make_modes: 1 3
    debug3: tty_make_modes: 2 28
    debug3: tty_make_modes: 3 127
    debug3: tty_make_modes: 4 21
    debug3: tty_make_modes: 5 4
    debug3: tty_make_modes: 6 0
    debug3: tty_make_modes: 7 0
    debug3: tty_make_modes: 8 17
    debug3: tty_make_modes: 9 19
    debug3: tty_make_modes: 10 26
    debug3: tty_make_modes: 12 18
    debug3: tty_make_modes: 13 23
    debug3: tty_make_modes: 14 22
    debug3: tty_make_modes: 18 15
    debug3: tty_make_modes: 30 0
    debug3: tty_make_modes: 31 0
    debug3: tty_make_modes: 32 0
    debug3: tty_make_modes: 33 0
    debug3: tty_make_modes: 34 0
    debug3: tty_make_modes: 35 0
    debug3: tty_make_modes: 36 1
    debug3: tty_make_modes: 37 0
    debug3: tty_make_modes: 38 1
    debug3: tty_make_modes: 39 0
    debug3: tty_make_modes: 40 0
    debug3: tty_make_modes: 41 0
    debug3: tty_make_modes: 50 1
    debug3: tty_make_modes: 51 1
    debug3: tty_make_modes: 52 0
    debug3: tty_make_modes: 53 1
    debug3: tty_make_modes: 54 1
    debug3: tty_make_modes: 55 1
    debug3: tty_make_modes: 56 0
    debug3: tty_make_modes: 57 0
    debug3: tty_make_modes: 58 0
    debug3: tty_make_modes: 59 1
    debug3: tty_make_modes: 60 1
    debug3: tty_make_modes: 61 1
    debug3: tty_make_modes: 62 0
    debug3: tty_make_modes: 70 1
    debug3: tty_make_modes: 71 0
    debug3: tty_make_modes: 72 1
    debug3: tty_make_modes: 73 0
    debug3: tty_make_modes: 74 0
    debug3: tty_make_modes: 75 0
    debug3: tty_make_modes: 90 1
    debug3: tty_make_modes: 91 1
    debug3: tty_make_modes: 92 0
    debug3: tty_make_modes: 93 0
    debug2: channel 0: request shell confirm 0
    debug2: fd 3 setting TCP_NODELAY
    debug2: callback done
    debug2: channel 0: open confirm rwindow 0 rmax 32768
    debug2: channel 0: rcvd adjust 131072


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    noddy:applprod(EBSP)/home/applprod/.ssh>ssh -vvv applprod@horton
    OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to horton [10.x.x.x] port 22.
    debug1: Connection established.
    debug1: identity file /home/applprod/.ssh/identity type -1
    debug3: Not a RSA1 key file /home/applprod/.ssh/id_rsa.
    debug2: key_type_from_name: unknown key type '-----BEGIN'
    debug3: key_read: missing keytype
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug2: key_type_from_name: unknown key type '-----END'
    debug3: key_read: missing keytype
    debug1: identity file /home/applprod/.ssh/id_rsa type 1
    debug1: identity file /home/applprod/.ssh/id_dsa type -1
    debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
    debug1: match: OpenSSH_3.9p1 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_3.9p1
    debug2: fd 3 setting O_NONBLOCK
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit: none,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_init: found hmac-md5
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug2: mac_init: found hmac-md5
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    debug2: dh_gen_key: priv key bits set: 145/256
    debug2: bits set: 503/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: check_host_in_hostfile: filename /home/applprod/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug3: check_host_in_hostfile: filename /home/applprod/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug1: Host 'horton' is known and matches the RSA host key.
    debug1: Found key in /home/applprod/.ssh/known_hosts:1
    debug2: bits set: 526/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/applprod/.ssh/identity ((nil))
    debug2: key: /home/applprod/.ssh/id_rsa (0x80f5708)
    debug2: key: /home/applprod/.ssh/id_dsa ((nil))
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug3: start over, passed a different list publickey,gssapi-with-mic,password
    debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
    debug3: authmethod_lookup gssapi-with-mic
    debug3: remaining preferred: publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-with-mic
    debug1: Next authentication method: gssapi-with-mic
    debug2: we sent a gssapi-with-mic packet, wait for reply
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug2: we sent a gssapi-with-mic packet, wait for reply
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/applprod/.ssh/identity
    debug3: no such identity: /home/applprod/.ssh/identity
    debug1: Offering public key: /home/applprod/.ssh/id_rsa
    debug3: send_pubkey_test
    debug2: we sent a publickey packet, wait for reply
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug1: Trying private key: /home/applprod/.ssh/id_dsa
    debug3: no such identity: /home/applprod/.ssh/id_dsa
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup password
    debug3: remaining preferred: ,password
    debug3: authmethod_is_enabled password
    debug1: Next authentication method: password

  11. #11
    Membre émérite Avatar de jmelyn
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Septembre 2007
    Messages
    703
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux

    Informations forums :
    Inscription : Septembre 2007
    Messages : 703
    Par défaut
    Le serveur ssh sur noddy reçoit bien la requête du client ssh sur horton, et renvoie bien une réponse.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    debug2: we sent a publickey packet, wait for reply
    debug1: Server accepts key: pkalg ssh-rsa blen 149
    Par contre, il n'y a pas de réponse dans l'autre sens.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    debug2: we sent a publickey packet, wait for reply
    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    Le problème est donc que le serveur ssh sur horton n'est pas correctement configuré. Il faut modifier son fichier /etc/ssh/sshd_config. Le plus simple est de prendre le fichier de noddy et de le copier sur horton (et mieux vaut faire une copie du fichier fautif plutôt que de l'écraser simplement). Un diff entre les deux donnera la (les) ligne(s) fautives.

  12. #12
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    Merci de ton aide, mais j'ai deja verifier ce fichier et c'est exactement le meme.

    Ensuite j'ai créé des utilisateurs et c'est la que ca devient marrant.

    Exemple

    Bobo@horton va vers bobo@noddy mais pas l'inverse.

    Par contre lolo@noddy peut aller sur lolo@horton ????

    La manip reste la meme et pour cet user bobo, ça bloque.

    Puisque lolo peut aller sur norton ce n'est pas un problème de configuration.

  13. #13
    Membre émérite Avatar de jmelyn
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Septembre 2007
    Messages
    703
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux

    Informations forums :
    Inscription : Septembre 2007
    Messages : 703
    Par défaut
    Le fait qu'un utilisateur puisse se connecter dans les deux sens par ssh ne veut pas dire que la config des daemons ssh est correcte: Il existe par exemple dans /etc/sshd_config les paramètres suivants: AllowGroups, AllowUsers, DenyGroups et DenyUsers. De plus, la config système de l'utilisateur doit aussi être correcte, c'est-à-dire que l'utilisateur doit pouvoir se connecter directement sur la machine (utilisateur défini et valide).

    Si tout cela est correct, alors la config ssh utilisateur ne va pas bien: les $(HOME)/.ssh sur les machines cliente et serveur ne correspondent pas ou ont des droits inappropriés.

    La gestion ssh demande beaucoup de rigueur. Un seul grain de sable et tout le système coince. C'est pourquoi je préfère utiliser des scripts pour être certain que le même traitement s'est appliqué sur toutes les machines; donc soit ça marche, soit j'ai lamentablement merdé et les utilisateurs s'empresseront de me le faire savoir.

  14. #14
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    Salut j'ai supprimé le .ssh de chaque utilisateur, puis recréé avec connexion ssh et maintenant tout fonctionne à merveille

    Merci de ton aide

  15. #15
    Membre éclairé
    Homme Profil pro
    Responsable Applicatif / Développeur
    Inscrit en
    Mai 2007
    Messages
    495
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Responsable Applicatif / Développeur

    Informations forums :
    Inscription : Mai 2007
    Messages : 495
    Par défaut
    J'ai fait comme toi :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    scp id_rsa.pub bobo@titeuf:.ssh
     
    ssh bobo@titeuf
    cd ~/.ssh/
    cat id_rsa.pub >> authorized.keys
    chmod 640 authorized.keys
     
    Serveur titeuf
     
     
    cd ~/.ssh/
     
    ssh-keygen  -t rsa
    scp id_rsa.pub bobo@pegase:.ssh
     
    ssh bobo@pegase
    cd ~/.ssh/
    cat id_rsa.pub >> authorized.keys
    Mais le problème c'est que SSH me demande toujours le mot de passe, sauf si je le désactive sans le sshd_config (mais alors il est désactivé pour tout les comptes du serveur).

    Comment as tu fait?

    "j'ai supprimé le .ssh de chaque utilisateur, puis recréé avec connexion ssh et maintenant tout fonctionne à merveille"

  16. #16
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    48
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 48
    Par défaut
    J'ai fais une erreur de frappe

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    ssh bobo@titeuf
    cd ~/.ssh/
    cat id_rsa.pub >> authorized_keys
    chmod 640 authorized.keys
     
    Serveur titeuf
     
     
    cd ~/.ssh/
     
    ssh-keygen  -t rsa
    scp id_rsa.pub bobo@pegase:.ssh
     
    ssh bobo@pegase
    cd ~/.ssh/
    cat id_rsa.pub >> authorized_keys

    c'est authorized_keys et pas authorized.keys

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 0
    Dernier message: 18/04/2013, 12h21
  2. Partage par ssh
    Par troumad dans le forum Réseau
    Réponses: 19
    Dernier message: 15/04/2006, 09h02
  3. Partager son disque
    Par tintin22 dans le forum Web & réseau
    Réponses: 2
    Dernier message: 16/09/2002, 01h34
  4. Réponses: 4
    Dernier message: 13/05/2002, 17h43
  5. Peux t'on créer une copie locale de l'objet partagé?
    Par Anonymous dans le forum CORBA
    Réponses: 8
    Dernier message: 16/04/2002, 17h20

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo