- Modifié
Tu as une de ces deux cles privees sur ta machine (locale) ?debug1: Offering public key: /home/xxxx/.ssh/id_rsa
...
debug1: Offering public key: /home/xxxx/.ssh/id_dsa
Tu as une de ces deux cles privees sur ta machine (locale) ?debug1: Offering public key: /home/xxxx/.ssh/id_rsa
...
debug1: Offering public key: /home/xxxx/.ssh/id_dsa
ouiDifool wrote:Tu as une de ces deux cles privees sur ta machine (locale) ?debug1: Offering public key: /home/xxxx/.ssh/id_rsa
...
debug1: Offering public key: /home/xxxx/.ssh/id_dsa
[user@local .ssh]$ ls
authorized_keys id_dsa.pub id_rsa.pub known_hosts
id_dsa id_rsa
Pourquoi cela pour toi ? Puisque tu fais le bon raisonnement ensuite ? O_otdt29 wrote:je m'explique, pour moi, la machine local, c'est le serveur (celui sur lequel on veux avoir accès) et la machine distante c'est le client (le pc que j'utilise pour accéder au serveur).
etil faut d'abord vérifier le contenu de authorized_keys sur le serveur et la clé publique sur le client.
qu'il veulent dire la même chose. La première citation est limpide comme de l'eau de roche, la deuxième est plus ambiguë (A mon sens bien entendu).le contenu de id_dsa.pub de la machine locale est-il bien recopie dans le fichier authorized_keys de la machine distante ?
disons que là je viens encore de reinstaller une machine sous fedora, et sur la nouvelle machine distante ça marche donc ça ne m'avance ps, je ne comprend toujours pas pourquoi cette fonction s'arrete à un moment donnéDifool wrote:C'est simple : Y'a un truc que t'as loupe.
Vu que tu n'as pas repondu :
Le contenu de ta cle publique id_rsa.pub ou id_dsa.pub a-t-il bien ete recopie dans le fichier authorized_keys de la machine distante ?
La machine distante est-elle configuree pour accepter l'authentification par cle (Sans oublier de recharger la conf ou relancer le serveur SSH) ?
J'imagine que oui, vu qu'elle essaie, mais bon ...
je viens d'effacer le contenu du dossier .ssh de l'ordi distant puis j'ai faitpmarion wrote:Si cela fonctionne sur un serveur sshd et pas sur un autre serveur sshd, c'est que le répertoire .ssh présente une différence.
copie le .ssh d'un des deux serveurs sur l'autre dans /tmp et compare les .ssh avec diff.
ssh-copy-id -i ~/.ssh/id_dsa ordi_distant
et mem resultat aussi en supprimant le dossierFaux !pmarion wrote:Si cela fonctionne sur un serveur sshd et pas sur un autre serveur sshd, c'est que le répertoire .ssh présente une différence.
copie le .ssh d'un des deux serveurs sur l'autre dans /tmp et compare les .ssh avec diff.
ssh-copy-id -i ~/.ssh/id_dsa machineB
et là ça marche ssh-copy-id -i ~/.ssh/id_dsa machineC
et là quand je teste de me connecter me demande tout de même mot de passedrwx------ 2 user user 4096 aoû 4 13:08 .ssh
de machine C
drwx------ 2 user user 4096 oct 18 14:44 .ssh
etc/ssh machine B
-rw------- 1 root root 125811 jui 31 12:35 moduli
-rw-r--r-- 1 root root 1964 jui 31 12:35 ssh_config
-rw------- 1 root root 3717 jui 31 12:35 sshd_config
-rw------- 1 root root 668 oct 8 20:31 ssh_host_dsa_key
-rw-r--r-- 1 root root 590 oct 8 20:31 ssh_host_dsa_key.pub
-rw------- 1 root root 963 oct 8 20:31 ssh_host_key
-rw-r--r-- 1 root root 627 oct 8 20:31 ssh_host_key.pub
-rw------- 1 root root 1671 oct 8 20:31 ssh_host_rsa_key
-rw-r--r-- 1 root root 382 oct 8 20:31 ssh_host_rsa_key.pub
etc/ssh machine C
-rw------- 1 root root 132839 nov 20 2007 moduli
-rw-r--r-- 1 root root 1955 nov 20 2007 ssh_config
-rw------- 1 root root 3644 nov 20 2007 sshd_config
-rw------- 1 root root 668 aoû 3 23:29 ssh_host_dsa_key
-rw-r--r-- 1 root root 590 aoû 3 23:29 ssh_host_dsa_key.pub
-rw------- 1 root root 963 aoû 3 23:29 ssh_host_key
-rw-r--r-- 1 root root 627 aoû 3 23:29 ssh_host_key.pub
-rw------- 1 root root 1675 aoû 3 23:29 ssh_host_rsa_key
-rw-r--r-- 1 root root 382 aoû 3 23:29 ssh_host_rsa_key.pub
sshd_config machine B okDifool wrote:Et des machines A, B, C laquelle est le serveur SSH ? La machine A ?
Accessoirement, créer une clé pour chaque machine, plutôt que la copier, ça ne serait pas mieux ?
Peux-tu montrer le /etc/ssh/sshd_config de la machine distante ?
# $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
sshd_config machine C pas ok
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 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 1024
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#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 LANGUAGE
#AllowAgentForwarding yes
#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
#ChrootDirectory none
# no default banner path
#Banner none
# 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
Faudrait ptet décommenter ça pour que ça fonctionne ?#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
ls -al
total 24
drwx------ 2 user user 4096 2008-08-04 13:08 .
drwx------ 32 user user 4096 2008-10-18 15:10 ..
-rw------- 1 user user 1825 2008-10-18 14:41 authorized_keys
-rw------- 1 user user 602 2008-08-04 11:17 authorized_keys~
-rw-r--r-- 1 user user 803 2008-08-23 15:21 known_hosts
ordinateur C serveur
ls -al
total 12
drwx------ 2 user user 4096 oct 18 14:44 .
drwxrwxrwx 30 user user 4096 oct 18 15:14 ..
-rw------- 1 user user 616 oct 18 14:44 authorized_keys