Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
887 connectés 

  FORUM HardWare.fr
  Systèmes & Réseaux Pro
  Réseaux

  Problème connexion SSH

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Problème connexion SSH

n°55661
ido-
Posté le 07-07-2009 à 11:01:27  profilanswer
 

Bonjour les amis,
 
 
je viens d'effectuer une migration d'un serveur au boulot d'un site à l'autre, et depuis j'ai des problèmes SSH.  
Le serveur faisant défaut utilise pour ses connexion des clés. Il se trouve que depuis notre migration, les utilisateurs souhaitant se connecter, recoivent un message d'erreur à l'ouverture de session ("Network Error: software caused connection abort" ).
 
 
Après plusieurs essais infructueux de changement de configuration, nous sommes passé d'une authentification par clés (situation normale) à une authentification par password simples (en guise de solution de contournement temporaire).
 
 
Néanmoins, cette authentification par password ne marche pas non plus. Lorsqu'un utilisateur système essaye de se connecter, la session putty se ferme automatiquement à l'entrée du mot de passe utilisateur. Ci-après le output du mode verbose d'une tentative de connexion pour un utilisateur normal:
 
 
 

Citation :

debug1: Connecting to server [ip] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 Deb                                             ian-8.sarge.4
debug1: match: OpenSSH_3.8.1p1 Debian-8.sarge.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1 Debian-8.sarge.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
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
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'server' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:23
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: password,keyboard-interactive
debug1: Next authentication method: password
kahl@server's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: client_input_channel_req: channel 0 rtype exit-signal reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to server closed.


 
 
 
-----------------
 
 
 
Le fait est que seul le login "root" peut se logger au serveur.
 
 
 
Ci-après le output du mude debug pour le compte root :
 
 
 

Citation :

debug1: Connecting to server [2001:660:3002:4001:2000::] port 22.
debug1: connect to address 2001:660:3002:4001:2000:: port 22: Network is unreachable
debug1: Connecting to server [ip] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 Debian-8.sarge.4
debug1: match: OpenSSH_3.8.1p1 Debian-8.sarge.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1 Debian-8.sarge.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
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
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'server' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:23
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: password,keyboard-interactive
debug1: Next authentication method: password
root@server's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
Last login: Mon Jul  6 17:20:10 2009 from server2


 
 
 
Le sshd_config:
 

Citation :

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
 
KeyRegenerationInterval 3600
ServerKeyBits 1024
 
# ...but breaks Pam auth via kbdint, so we have to turn it off
# Use PAM authentication via keyboard-interactive so PAM modules can
# properly interface with the user (off due to PrivSep)
#PAMAuthenticationViaKbdInt yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024
 
# Logging
SyslogFacility AUTH
#SyslogFacility sshd
LogLevel INFO
 
# Authentication:
LoginGraceTime 600
PermitRootLogin yes
StrictModes yes
 
RSAAuthentication no
PubkeyAuthentication no
#AuthorizedKeysFile     %h/.ssh/authorized_keys
 
# rhosts authentication should not be used
#RhostsAuthentication no
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
IgnoreUserKnownHosts yes
 
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
 
# Uncomment to disable s/key passwords
#ChallengeResponseAuthentication no
 
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials no
 
# To change Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no
 
# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes
 
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
#PrintLastLog no
KeepAlive yes
#UseLogin no
 
#MaxStartups 10:30:60
Banner /etc/ssh/banner.ssh
#ReverseMappingCheck yes
 
Subsystem       sftp    /usr/lib/sftp-server


 
 
 
 
 
--------------------
 
Le fait que seul le compte root arrive à se connecter me fait penser à un problème de compte... Pour info, le /home des users est en fait un lien symbolique pointant vers une partition montée sur /export/home
Ceci dit, les users pouvaient parfaitement se connecter avec le déplacement du serveur...
 
Merci


Message édité par ido- le 07-07-2009 à 11:51:07

---------------
Mes feeds: http://forum.hardware.fr/hfr/Achat [...] 8984_1.htm
mood
Publicité
Posté le 07-07-2009 à 11:01:27  profilanswer
 

n°55667
ido-
Posté le 07-07-2009 à 11:51:52  profilanswer
 

De plus, dans le /var/log/auth.log, voila ce que j'ai :
 
Jul  6 15:25:03 server sshd[27510]: Accepted publickey for xav from ::ffff:ip.ip.ip.ip port 3086 ssh2
 
Donc je rentre bien dans le système... Dès la rentrée du mot de passe (ou l'acceptation de la clé), putty se ferme et me dégage... mais je suis rentré.


---------------
Mes feeds: http://forum.hardware.fr/hfr/Achat [...] 8984_1.htm
n°55669
slywalker
Posté le 07-07-2009 à 12:46:35  profilanswer
 

Salut,
 
moi j'aurais remplacé ça :

Citation :

RSAAuthentication no
PubkeyAuthentication no


 
par :

Citation :

RSAAuthentication yes
PubkeyAuthentication yes


 
Peux-tu faire le test stp ?
 
PS : ma solution c'est pour voir si ça marche en login/mdp, ce n'est pas une solution à ton problème avec les clés !

n°55674
ido-
Posté le 07-07-2009 à 14:34:05  profilanswer
 

Hello,
 
oui j'ai déjà testé ça + la directe PasswordAuthentication yes
Mais pour que cette méthode d'auth marche, bizarrement, j'ai du également modifier la directive : UsePrivilegeSeparation no
 qui était à yes...
 
Et là je peux me connecter en mdp.  
Je me suis dis "chouette, y'a plus qu'a remettre l'auth par clés, puisque c'était la directive UsePrivilegeSeparation qui n'allait pas".
 
Je désactive donc l'auth par mdp et active celle par clé, et maintenant j'ai dans mon auth.log :
 
Jul  7 14:32:16 server sshd[925]: Accepted publickey for xav from ::ffff:ip.ip.ip.ip port 2502 ssh2
Jul  7 14:32:16 server sshd[925]: syslogin_perform_logout: logout() returned an error


Message édité par ido- le 07-07-2009 à 14:38:50

---------------
Mes feeds: http://forum.hardware.fr/hfr/Achat [...] 8984_1.htm

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Systèmes & Réseaux Pro
  Réseaux

  Problème connexion SSH

 

Sujets relatifs
Probleme connexion.Problème avec Zyxel 662HW-61
Connexion entre SAN et serveur[Windows 2003] [RESOLU] Problème de configuration DHCP
Automatisation d'une connexion WIFIDeploiment script pour installaiton logiciel .EXE problème droit admin
Tâches planifiées et problème de lancementCisco Catalyst 4006 Acces Console, premiere connexion
Problème Message instantané (nethail) 
Plus de sujets relatifs à : Problème connexion SSH


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR