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

Réseau Discussion :

Problème de connexion SSH


Sujet :

Réseau

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2010
    Messages
    27
    Détails du profil
    Informations personnelles :
    Localisation : France, Yvelines (Île de France)

    Informations forums :
    Inscription : Mai 2010
    Messages : 27
    Points : 21
    Points
    21
    Par défaut Problème de connexion SSH
    Bonjour Linuxien

    Depuis quelques jours, je suis sur un problème avec le SSH.

    Ci-joint les infos.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    sudo ssh -v discovery
    OpenSSH_9.0p1 Debian-1+b1, OpenSSL 3.0.4 21 JUN 2022
    debug1: Reading configuration data /root/.ssh/config
    debug1: Reading configuration dat /etc/ssh/ssh_config
    ssh: Could not resolve hostname descovery: Temporary failure in name resolution
    ----------------------------------

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    ssh 212.83.142.84
    zsh: segmentation fault ssh 212.83.142.84

    J'ai consulté les fichiers
    /etc/ssh/sshd_config et etc/ssh/ssh_config sans constaté d'anomalie.


    -------------------------
    sshd_config
    ----------------------
    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
    # This is the sshd server system-wide configuration file.  See
    # sshd_config(5) for more information.
     
    # This sshd was compiled with PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
     
    # The strategy used for options in the default sshd_config shipped with
    # OpenSSH is to specify options with their default value where
    # possible, but leave them commented.  Uncommented options override the
    # default value.
     
    Include /etc/ssh/sshd_config.d/*.conf
     
    Ciphers aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
    #KexAlgorithms diffie-hellman-group1-sha1
    KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
    Ciphers 3des-cbc,aes128-cbc,aes128-ctr,aes256-ctr
     
     
    HostkeyAlgorithms ssh-dss,ssh-rsa
    PubkeyAcceptedKeyTypes ssh-dss,ssh-rsa
     
     
     
    # Adding all known cipher schemes (to be backward compatible - see ABFD-2267)
    #Ciphers +aes256-ctr,aes192-ctr,aes128-ctr,rijndael-cbc@lysator.liu.se,aes256-cbc,aes192-cbc,aes128-cbc,arcfour256,arcfour128,arcfour,cast128-cbc,blowfish-cbc,3des-cbc
     
    # Adding older KexAlgorithms (details ABFD-2291)
    #KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1
    #EOF
     
    Port 22
    #AddressFamily any
    #ListenAddress 0.0.0.0
    #ListenAddress ::
     
    HostKey /etc/ssh/ssh_host_rsa_key
    HostKey /etc/ssh/ssh_host_ecdsa_key
    HostKey /etc/ssh/ssh_host_ed25519_key
    HostKey /etc/ssh/ssh_host_dsa_key
    #HostKey /etc/ssh/ssh_host_dsa_key.pub
     
    # Ciphers and keying
    #RekeyLimit default none
     
    #KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
    # Ciphers 3des-cbc,blowfish-cbc,aes128-cbc,aes128-ctr,aes256-ctr
     
    # Logging
    #SyslogFacility AUTH
    #LogLevel INFO
     
    # Authentication:
     
    #LoginGraceTime 2m
    #PermitRootLogin prohibit-password
    #StrictModes yes
    #MaxAuthTries 6
    #MaxSessions 10
     
    #PubkeyAuthentication yes
     
    # Expect .ssh/authorized_keys2 to be disregarded by default in future.
    #AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2
     
    #AuthorizedPrincipalsFile none
     
    #AuthorizedKeysCommand none
    #AuthorizedKeysCommandUser nobody
     
    # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
    #HostbasedAuthentication no
    # Change to yes if you don't trust ~/.ssh/known_hosts for
    # HostbasedAuthentication
    #IgnoreUserKnownHosts no
    # Don't read the user's ~/.rhosts and ~/.shosts files
    #IgnoreRhosts yes
     
    # To disable tunneled clear text passwords, change to no here!
    #PasswordAuthentication yes
    #PermitEmptyPasswords no
     
    # Change to yes to enable challenge-response passwords (beware issues with
    # some PAM modules and threads)
    KbdInteractiveAuthentication no
     
    # Kerberos options
    #KerberosAuthentication no
    #KerberosOrLocalPasswd yes
    #KerberosTicketCleanup yes
    #KerberosGetAFSToken no
     
    # GSSAPI options
    #GSSAPIAuthentication no
    #GSSAPICleanupCredentials yes
    #GSSAPIStrictAcceptorCheck yes
    #GSSAPIKeyExchange no
     
    # Set this to 'yes' to enable PAM authentication, account processing,
    # and session processing. If this is enabled, PAM authentication will
    # be allowed through the KbdInteractiveAuthentication and
    # PasswordAuthentication.  Depending on your PAM configuration,
    # PAM authentication via KbdInteractiveAuthentication may bypass
    # the setting of "PermitRootLogin without-password".
    # If you just want the PAM account and session checks to run without
    # PAM authentication, then enable this but set PasswordAuthentication
    # and KbdInteractiveAuthentication to 'no'.
    UsePAM yes
     
    #AllowAgentForwarding yes
    #AllowTcpForwarding yes
    #GatewayPorts no
    X11Forwarding yes
    #X11DisplayOffset 10
    #X11UseLocalhost yes
    #PermitTTY yes
    PrintMotd no
    #PrintLastLog yes
    #TCPKeepAlive yes
    #PermitUserEnvironment no
    #Compression delayed
    #ClientAliveInterval 0
    #ClientAliveCountMax 3
    #UseDNS no
    #PidFile /run/sshd.pid
    #MaxStartups 10:30:100
    #PermitTunnel no
    #ChrootDirectory none
    #VersionAddendum none
     
    # no default banner path
    #Banner none
     
    # Allow client to pass locale environment variables
    AcceptEnv LANG LC_*
     
    # override default of no subsystems
    Subsystem	sftp	/usr/lib/openssh/sftp-server
     
    # Example of overriding settings on a per-user basis
    #Match User anoncvs
    #	X11Forwarding no
    #	AllowTcpForwarding no
    #	PermitTTY no
    #	ForceCommand cvs server
    ----------------------------

    ---------------------------------
    ssh_config
    -----------------------------

    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
       StrictHostKeyChecking=no
       IdentityFile	~/my_path/id_rsa.pub
     
     
    # This is the ssh client system-wide configuration file.  See
    # ssh_config(5) for more information.  This file provides defaults for
    # users, and the values can be changed in per-user configuration files
    # or on the command line.
     
    # Configuration data is parsed as follows:
    #  1. command line options
    #  2. user-specific file
    #  3. system-wide file
    # Any configuration value is only changed the first time it is set.
    # Thus, host-specific definitions should be at the beginning of the
    # configuration file, and defaults at the end.
     
    # Site-wide defaults for some commonly used options.  For a comprehensive
    # list of available options, their meanings and defaults, please see the
    # ssh_config(5) man page.
     
    #Include /etc/ssh/ssh_config.d/*.conf
     
    #Host *
    #   ForwardAgent no
    #   ForwardX11 no
    #   ForwardX11Trusted yes
    #   PasswordAuthentication yes
    #   HostbasedAuthentication no
    #   GSSAPIAuthentication no
    #   GSSAPIDelegateCredentials no
    #   GSSAPIKeyExchange no
    #   GSSAPITrustDNS no
    #   BatchMode no
    #   CheckHostIP yes
    #   AddressFamily any
    #   ConnectTimeout 0
    #   StrictHostKeyChecking ask
       IdentityFile ~/.ssh/id_rsa
       IdentityFile ~/.ssh/id_dsa
       IdentityFile ~/.ssh/id_ecdsa
       IdentityFile ~/.ssh/id_ed25519
       Port 22
       Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
    #   MACs hmac-md5,hmac-sha1,umac-64@openssh.com
    #   EscapeChar ~
    #   Tunnel no
    #   TunnelDevice any:any
    #   PermitLocalCommand no
    #   VisualHostKey no
    #   ProxyCommand ssh -q -W %h:%p gateway.example.com
    #   RekeyLimit 1G 1h
       UserKnownHostsFile ~/.ssh/known_hosts.d/%k
        SendEnv LANG LC_*
        HashKnownHosts yes
        GSSAPIAuthentication yes
     
     
    KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
    HostkeyAlgorithms ssh-dss,ssh-rsa
    PubkeyAcceptedKeyTypes ssh-dss,ssh-rsa
     
     
    StrictHostKeyChecking=no
    UserKnownHostsFile=/dev/null
    -------------------------------------------
    known_hosts je n'ai que la clé
    --------------------------------------

    -----------------------------------------
    /root/.ssh/config
    ----------------------------------------
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    UserKnownHostsFile ~/.ssh/known_hosts
    LogLevel=quiet
    -------------------------------------------


    Voilà les informations en ma possession.
    Si vous avez besoin d'autres information,je peux vous les fournir

    Quelqu'un aurait-il une idéé.

    Merci de votre aide

  2. #2
    Expert éminent sénior Avatar de disedorgue
    Homme Profil pro
    Ingénieur intégration
    Inscrit en
    Décembre 2012
    Messages
    4 277
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur intégration
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Décembre 2012
    Messages : 4 277
    Points : 12 725
    Points
    12 725
    Par défaut
    Difficile de comprendre le problème...

    sudo -v discovery
    OpenSSH_9.0p1 Debian-1+b1, OpenSSL 3.0.4 21 JUN 2022
    debug1: Reading configuration data /root/.ssh/config
    debug1: Reading configuration dat /etc/ssh/ssh_config
    ssh: Could not resolve hostname descovery: Temporary failure in name resolution
    Comprend pas les incohérence ici:
    sudo ????
    descovery pas résolu alors que tu demandes discovery

    As-tu essayé de lancer ta commande ssh avec plus d'option -vvv pour voir si on a une chance de voir à quel niveau de la connectivité il segfault ?

    Essaye aussi en virant ton fichier know_hosts de ton home.

    Sinon tu peux voir avec la commande trace pour suivre la stack d'execution jusqu'au plantage...
    Cordialement.

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2010
    Messages
    27
    Détails du profil
    Informations personnelles :
    Localisation : France, Yvelines (Île de France)

    Informations forums :
    Inscription : Mai 2010
    Messages : 27
    Points : 21
    Points
    21
    Par défaut
    Bonjour Disedorgue

    Tout d'abord merci de ta réponse

    J'ai corrigé la commande c'était sudo ssh -v @IP discovery pour avoir un peu plus de détails.

    De plus ci-joint le fichier de la commande SSH avec les options et un autre fichier avec le fichier knows_host supprimer.

    ssh option.txt

    ssh known.txt

    Le ping fonctionne bien et quand je fais un traceroute sur le port 22, j'obtiens une connexion

    sudo tcptraceroute 163.172.195.80 22

    6 * * *
    7 * * *
    8 * * *
    9 * * *
    10 * * *
    11 * * *
    12 * * *
    13 * * *
    14 * * *
    15 163.172.195.80 <syn,ack> 17.512 ms 17.664 ms 16.528 ms


    Aurais-tu d'autres pistes par rapport aux ficihiers que je viens de rajouter.

    Cordialement

  4. #4
    Expert éminent sénior Avatar de disedorgue
    Homme Profil pro
    Ingénieur intégration
    Inscrit en
    Décembre 2012
    Messages
    4 277
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur intégration
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Décembre 2012
    Messages : 4 277
    Points : 12 725
    Points
    12 725
    Par défaut
    Je dirais que ton soucis est sur cette option dans ton ssh_config:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
        GSSAPIAuthentication yes
    passe la à no pour voir car tu n'en as besoin que si tu utilises kerberos des 2 cotés (ce que je doute) et il segfault quand il essaye ce type d'authentification.
    Cordialement.

  5. #5
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2010
    Messages
    27
    Détails du profil
    Informations personnelles :
    Localisation : France, Yvelines (Île de France)

    Informations forums :
    Inscription : Mai 2010
    Messages : 27
    Points : 21
    Points
    21
    Par défaut
    Grand merci Disedorgue

    Tu avais raison, le problème venait bien de là

    Tout fonctionne maintenant

    Cordialement

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

Discussions similaires

  1. Problème de connexion ssh
    Par ludovic787 dans le forum Raspberry Pi
    Réponses: 3
    Dernier message: 30/09/2019, 10h01
  2. fwbuilder, problème de connexion SSH avec clés publiques/privées
    Par Michaeljackfan dans le forum Sécurité
    Réponses: 1
    Dernier message: 08/06/2016, 14h28
  3. Réponses: 3
    Dernier message: 01/02/2012, 19h05
  4. Problème de connexion SSH
    Par Ti-Dams dans le forum BSD
    Réponses: 1
    Dernier message: 05/12/2011, 14h34
  5. problème de connexion ssh (AIX)
    Par nora2311 dans le forum AIX
    Réponses: 0
    Dernier message: 11/02/2011, 09h21

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