우리는 소규모 사무실에서 Backuppc를 사용하고 있으며 Windows 7 PC와 일부 사용자는 Macbook을 사용하고 있습니다. Backuppc는 Ubuntu 12.04.2를 실행하는 서버에 있습니다. 비밀번호없는 ssh는 Snow Leopard 및 Lion에서 잘 작동하지만, 계속해서 비밀번호를 요구하면서 Mountain Lion과 씨름하고 있습니다. rsa 공개 키 교환 절차를 따르고 Backuppc 사용자의 공개 키를 Mountain Lion 호스트 시스템에 추가했습니다. 먼저 키를 .ssh 디렉토리의 'authorized_keys2'파일에 추가했습니다. 그것은 작동하지 않았다. Mountain Lion이 sshd 패키지를 업그레이드 한 것으로 보이는 것처럼 일부 검색을 수행 한 후 일부 사람들은 'authorized_keys'를 사용하도록 제안했습니다. 그것은 작동하지 않았다. .ssh 디렉토리 (700)와 'authorized_keys'에 대한 권한이 올바르게 설정되어 있다고 생각합니다. 파일 (편집 : 644). Backuppc 사용자에서 Mountain Lion이있는 머신으로 ssh하려고 할 때마다 비밀번호를 계속 묻습니다. 정말 짜증나. 아래에서는 누구나 힌트를 제공 할 수있는 경우를 대비하여 디버그 출력을 첨부합니다. 당신의 도움을 주셔서 대단히 감사합니다.
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:
의견에 대한 조언에 따라 Mountain Lion 대상 시스템에서 'sshd -d'를 실행했습니다. 먼저 'ssh'를 중지 한 다음 'sshd -d'를 실행하십시오. 아래에 결과를 붙여 넣습니다.
$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
Mountain Lionbaby 에서 sshd를 실행하여 진행 상황을 확인하십시오.
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
한 다음 실행 sudo /usr/sbin/sshd -d
합니다. 원래 질문 끝에 결과를 붙여 넣습니다.