Nous utilisons Backuppc dans notre petit bureau, avec une combinaison de PC sous Windows 7 et d’utilisateurs utilisant leurs Macbooks. Backuppc est assis sur un serveur exécutant Ubuntu 12.04.2. Ssh sans mot de passe fonctionne bien avec Snow Leopard et Lion, mais je me bats avec Mountain Lion, car il demande sans cesse le mot de passe. J'ai suivi la procédure d'échange des clés publiques rsa et ajouté la clé publique de l'utilisateur Backuppc à la machine hôte Mountain Lion. D'abord, j'ai ajouté la clé au fichier "allowed_keys2" dans le répertoire .ssh. Cela n'a pas fonctionné. Après avoir fait quelques recherches, certaines personnes ont suggéré d'utiliser plutôt «allowed_keys», car il semblerait que Mountain Lion ait mis à jour le paquet sshd. Cela n'a pas fonctionné non plus. Je pense que les autorisations sont définies correctement pour le répertoire .ssh (700) et les clés autorisées. fichier (édité: 644). Il continue à demander le mot de passe à chaque fois que j'essaie de ssh de l'utilisateur Backuppc à la machine avec Mountain Lion. Vraiment énervant. Ci-dessous, je joins la sortie de débogage au cas où n'importe qui pourrait fournir des indications. Merci beaucoup pour votre aide.
backuppc@ubuntu:~$ ssh -v user1@192.168.10.55
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.10.55 [192.168.10.55] port 22.
debug1: Connection established.
debug1: identity file /var/lib/backuppc/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /var/lib/backuppc/.ssh/id_rsa-cert type -1
debug1: identity file /var/lib/backuppc/.ssh/id_dsa type -1
debug1: identity file /var/lib/backuppc/.ssh/id_dsa-cert type -1
debug1: identity file /var/lib/backuppc/.ssh/id_ecdsa type -1
debug1: identity file /var/lib/backuppc/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9
debug1: match: OpenSSH_5.9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr 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: Server host key: RSA 4c:c3:21:8f:6e:59:60:a9:5f:94:75:01:2d:e2:03:3e
debug1: Host '192.168.10.55' is known and matches the RSA host key.
debug1: Found key in /var/lib/backuppc/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /var/lib/backuppc/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /var/lib/backuppc/.ssh/id_dsa
debug1: Trying private key: /var/lib/backuppc/.ssh/id_ecdsa
debug1: Next authentication method: keyboard-interactive
Password:
Suite aux conseils sur les commentaires, j'ai exécuté un 'sshd -d' sur la machine cible Mountain Lion. J'ai d'abord arrêté 'ssh' puis j'exécute le 'sshd -d'. Je vous colle les résultats ci-dessous:
$sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
$sudo /usr/sbin/sshd -d
debug1: sshd version OpenSSH_5.9p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug1: fd 6 clearing O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 6 out 6 newsock 6 pipe -1 sock 9
debug1: inetd sockets after dupping: 5, 5
Connection from 192.168.10.100 port 34179
debug1: Client protocol version 2.0; client software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug1: permanently_set_uid: 75/75 [preauth]
debug1: list_hostkey_types: ssh-rsa,ssh-dss [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: client->server aes128-ctr hmac-md5 none [preauth]
debug1: kex: server->client aes128-ctr hmac-md5 none [preauth]
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received [preauth]
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent [preauth]
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT [preauth]
debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user user1 service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "user1"
debug1: PAM: setting PAM_RHOST to "ubuntu"
debug1: userauth-request for user user1 service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: test whether pkalg/pkblob are acceptable [preauth]
debug1: temporarily_use_uid: 502/20 (e=0/0)
debug1: trying public key file /Users/user1/.ssh/authorized_keys
debug1: fd 6 clearing O_NONBLOCK
Authentication refused: bad ownership or modes for directory /Users/user1
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 502/20 (e=0/0)
debug1: trying public key file /Users/user1/.ssh/authorized_keys2
debug1: fd 6 clearing O_NONBLOCK
Authentication refused: bad ownership or modes for directory /Users/user1
debug1: restore_uid: 0/0
Failed publickey for user1 from 192.168.10.100 port 34179 ssh2
debug1: audit_event: unhandled event 6
debug1: userauth-request for user user1 service ssh-connection method keyboard-interactive [preauth]
debug1: attempt 2 failures 1 [preauth]
debug1: keyboard-interactive devs [preauth]
debug1: auth2_challenge: user=user1 devs= [preauth]
debug1: kbdint_alloc: devices 'pam' [preauth]
debug1: auth2_challenge_start: trying authentication method 'pam' [preauth]
Postponed keyboard-interactive for user1 from 192.168.10.100 port 34179 ssh2 [preauth]
debug1: do_pam_account: called
debug1: PAM: num PAM env strings 2
Postponed keyboard-interactive/pam for user1 from 192.168.10.100 port 34179 ssh2 [preauth]
debug1: do_pam_account: called
Accepted keyboard-interactive/pam for user1 from 192.168.10.100 port 34179 ssh2
debug1: monitor_read_log: child log fd closed
debug1: monitor_child_preauth: user1 has been authenticated by privileged process
debug1: PAM: establishing credentials
User child is on pid 3240
debug1: PAM: establishing credentials
debug1: permanently_set_uid: 502/20
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch_20
debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_global_request: rtype no-more-sessions@openssh.com want_reply 0
debug1: server_input_channel_req: channel 0 request pty-req reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req pty-req
debug1: Allocating pty.
debug1: session_new: session 0
debug1: session_pty_req: session 0 alloc /dev/ttys001
debug1: Ignoring unsupported tty mode opcode 37 (0x25)
debug1: Ignoring unsupported tty mode opcode 52 (0x34)
debug1: Ignoring unsupported tty mode opcode 71 (0x47)
debug1: server_input_channel_req: channel 0 request env reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req env
debug1: server_input_channel_req: channel 0 request shell reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req shell
debug1: Setting controlling tty using TIOCSCTTY.
-d
sur le Mountain Lionbaby pour voir ce qui se passe.
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
puis couru sudo /usr/sbin/sshd -d
. Je vous colle les résultats à la fin de la question initiale.