En clair,
Je me connecte en ssh sans entrer le mdp en root grace à la clé.
Mais pour l'User, je dois rentrer le mdp, donc il n'utilise pas la clé.

Hors la clé est dans :
Pour root : /root/.ssh/authorized_keys
Pour User : /home/User/.ssh/authorized_keys
En gros, tu fais :
$ ssh root@host <---- aucun mdp demandé.
$ ssh user@host <---- le mdp est demandé.

C'est ça ?

as tu le même fichier authorized_keys pour root et user ?
Que donne un "md5sum /root/.ssh/authorized_keys /home/User/.ssh/authorized_keys" ?

Ca devrait fonctionner.
Vérifie les droits du fichier authorized_keys : il doit être en 600
Bonjour,

Relis le tuto dont tu parles en #1.
La réponse à ton souci s'y trouve.
@codo : Oui c'est bien ca.

Cependant, ta commande ne marche pas dans mon cas...

Voici le retour quand je désactive la demande de password :
Permission denied (publickey,gssapi-with-mic).
As tu respecté les droits sur les répertoires et fichiers ?
Rajoute les options -vv sur la commande ssh pour avoir + d'infos
[Dominique@LightDragon ~]$ ssh 192.168.1.4 -l Leviathan -vv
OpenSSH_4.7p1, 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 192.168.1.4 [192.168.1.4] port 22.
debug1: Connection established.
debug1: identity file /home/Dominique/.ssh/identity type -1
debug1: identity file /home/Dominique/.ssh/id_rsa type -1
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug2: key_type_from_name: unknown key type '-----END'
debug1: identity file /home/Dominique/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7
debug1: match: OpenSSH_4.7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,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,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,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-sha256,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,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,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_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: 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: 114/256
debug2: bits set: 499/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '192.168.1.4' is known and matches the RSA host key.
debug1: Found key in /home/Dominique/.ssh/known_hosts:1
debug2: bits set: 511/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/Dominique/.ssh/identity ((nil))
debug2: key: /home/Dominique/.ssh/id_rsa ((nil))
debug2: key: /home/Dominique/.ssh/id_dsa (0x2aaaaad2c5d0)
debug1: Authentications that can continue: publickey,gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information


debug2: we did not send a packet, disable method
debug1: Next authentication method: publickey
debug1: Trying private key: /home/Dominique/.ssh/identity
debug1: Trying private key: /home/Dominique/.ssh/id_rsa
debug1: Offering public key: /home/Dominique/.ssh/id_dsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-with-mic).
@proxy : As tu respecté les droits sur les répertoires et fichiers ?
Comment ca ?


@cenomanien : J'ai relu, mais je ne vois toujours pas le problème ?!
Si j'ai bien tout compris, Dominique@LightDragon se connecte en ssh à Leviathan@192.168.1.4
Une question bête, que contient /home/Leviathan/.ssh/authorized_keys sur le host 192.168.1.4 ?

Peux tu aussi nous faire un "ls -l /home/Leviathan/.ssh/authorized_keys"
@codo : Oui c'est ca
[root@Leviathan .ssh]# ls -l /home/Leviathan/.ssh/authorized_keys
-rw------- 1 root root 611 mai 22 22:02 /home/Leviathan/.ssh/authorized_keys
Encore : la réponse est dans le tuto.
Tu ne l'as pas bien lu.
Les posteurs précédents ont commencé à te guider vers la solution.

Bonne lecture
@cenomanien :
J'ai relu le tutorial, mais je ne trouve toujours pas ce que tu veux dire.

J'ai changer les droits/propriétaire du dossier/fichier comme indiqué dans le tuto, me disant que ca pouvait être ca.
Mais rien.

Donc soit j'ai encore mal lu, soit je ne comprends pas du tout ce que tu cherches à me dire.

La seule chose que je vois de différent entre une connexion root et utilisateur c'est :
debug2: we did not send a packet, disable method
Je le redis :
[Dominique@LightDragon ~]$ ssh 192.168.1.4 -l root
Ca passe
[Dominique@LightDragon ~]$ ssh 192.168.1.4 -l Leviathan
Ca passe plus, il me demande le mdp
eldege wrote:@codo : Oui c'est ca
[root@Leviathan .ssh]# ls -l /home/Leviathan/.ssh/authorized_keys
-rw------- 1 root root 611 mai 22 22:02 /home/Leviathan/.ssh/authorized_keys
Comme suggéré plus haut, le problème vient du fichier authorized_keys.
Il est bien en chmod 600, mais le user/group du fichier est root. Ca doit être Leviathan.
Justement, j'ai remis les droits comme tel, mais ca ne passe pas.
Enfin je testerais denouveau chez moi.
Sinon ca ne pourrait pas venir d'autre part donc ?

Merci de votre aide.
Le répertoire .ssh doit être en 700
Bonsoir, je viens de mettre les droits comme demande.

Citation tutorial :
Il faut vérifier les droits sur les clés, SSH nécessite que le dossier .ssh ait les permissions 700 (rwx pour l'utilisateur, rien pour le groupe et les autres), les clés privées ainsi que authorized_keys 600 (r pour l'utilisateur, rien pour le groupe et les autres) et les clés publiques 644 (rw pour l'utilisateur, read pour le groupe et les autres). Il faut aussi vérifier que chaque clé tient sur une ligne dans authorized_keys (même si elle apparait sur plusieurs ligne a l'écran, dans le fichier elle ne correspond qu'à une ligne).
Le dossier .ssh est bien en 700. Le fichier en 600. sous Leviathan.Leviathan, ca marche pas.
J'ai mis en 644 au fichier, et j'essaye mais ca marche pas...
Avoir les bons droits et le bon propriétaire sur authorized_keys est nécessaire, sinon ça ne fonctionne pas. Mais il y a un 2ème problème.
Fait un md5sum sur /home/Leviathan/.ssh/authorized_keys et sur /home/Dominique/.ssh/id_rsa.pub
Sont ils identiques ?
As-tu modifié quelque chose dans /etc/ssh/sshd_config ?
Ou alors, pour Leviathan, id_rsa ne correspond pas à id_rsa.pub

Revenons à un test basic :
$ cp id_rsa.pub authorized_keys
$ chmod 600 authorized_keys
$ ssh localhost
#    $OpenBSD: sshd_config,v 1.75 2007/03/19 01:01:29 djm Exp $

# 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:/bin:/usr/bin

# 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 change a
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6

#RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile    .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and 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
PasswordAuthentication yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing, 
# and session processing. If this is enabled, PAM authentication will 
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication 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 ChallengeResponseAuthentication to 'no'.
#UsePAM no
UsePAM yes

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
AcceptEnv LC_IDENTIFICATION LC_ALL
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem    sftp    /usr/libexec/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#    X11Forwarding no
#    AllowTcpForwarding no
#    ForceCommand cvs server
J'ai essayé de faire ta manipe, j'ai pas trop compris...

Je voulais juste dire que c'est une clé dsa pas rsa.
Le but de la manipe es de voir si ta clé fonctionne en local.
sshd_config semble être par défaut.
C'est bien le sshd_config sur le host leviathan que tu as posté ?

Je ne vois pas. Régénère une clef et refait le test. J'ai mis en place les clef ssh (rsa) sur pas mal de machines. Ca fonctionne bien. Le problème que l'on peut avoir c'est quand on copie la clef avec un copier/coller sous vi. Si un retour charriot est mal positionné, la clef est invalide. C'est pour ça que je t'ai demandé de vérifier le md5sum des fichiers pour être sûr que c'est bon.
La clé doit être copiée avec scp. C'est une méthode fiable.