SSH a localhost en OS X Mountain Lion falla con una contraseña no válida (después de reinstalar y migrar)

Después de reinstalar OS X, luego de migrar mi cuenta a través de Time Machine, no puedo usar SSH en localhost. Me pide una contraseña, pero no toma la contraseña de mi usuario real.

Intenté configurar una entrada ~/.ssh/authorized_keys también, pero aún solicita la contraseña. Incluso intenté reconstruir mi clave ssh que no ayudó.

Aquí está mi salida detallada de ssh:

> ssh -vvv localhost
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/dolan/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /Users/dolan/.ssh/id_rsa type -1
debug1: identity file /Users/dolan/.ssh/id_rsa-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/dolan/.ssh/id_dsa" as a RSA1 public key
debug1: identity file /Users/dolan/.ssh/id_dsa type 2
debug1: identity file /Users/dolan/.ssh/id_dsa-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.9
debug2: fd 5 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "localhost" from file "/Users/dolan/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
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-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,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-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,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-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,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-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,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-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
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
debug2: dh_gen_key: priv key bits set: 129/256
debug2: bits set: 463/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA e9:e2:c4:ef:08:08:ac:15:c5:b9:fd:c3:c3:b4:74:04
debug3: load_hostkeys: loading entries for host "localhost" from file "/Users/dolan/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is e9:e2:c4:ef:08:08:ac:15:c5:b9:fd:c3:c3:b4:74:04.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
debug2: bits set: 484/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: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/dolan/.ssh/id_rsa (0x0)
debug2: key: /Users/dolan/.ssh/id_dsa (0x7f81ebc1d3a0)
debug1: Authentications that can continue: publickey,keyboard-interactive
debug3: start over, passed a different list publickey,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/dolan/.ssh/id_rsa
debug3: no such identity: /Users/dolan/.ssh/id_rsa
debug1: Offering DSA public key: /Users/dolan/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:
debug3: packet_send2: adding 32 (len 27 padlen 5 extra_pad 64)
debug1: Authentications that can continue: publickey,keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:

¿Alguna idea sobre el problema o cómo depurar más?

Editar: probé dolan@localhost cuando ssh'ing, y el mismo resultado. Además, /etc/sshd_config debería ser el predeterminado desde que lo reinstalé. Intenté habilitar UsePAM (no hay lógica de por qué intenté esto, aparte de verlo mencionado en algún foro), y no ayudó. ¿Alguna otra configuración de SSH que podría necesitar cambios?

Hmm, debería poder escribir su contraseña e ingresar, ¿/private/var/log/system.log tiene alguna entrada sshd curiosa? Es posible que necesite que se ejecute en modo detallado, ya que la depuración de ssh es buena cuando no puede ver el demonio principal, pero nada en esa salida parece defectuoso (especialmente porque está obteniendo una promoción de contraseña)
En system.log, aparece "error: PAM: permiso denegado para dolan desde localhost a través de :: 1". ¿Hay una configuración de SSH en la cuenta de usuario que necesito habilitar?
Lo descubrí después de buscar en Google ese error. El "permitir acceso para" en el inicio de sesión remoto tiene un "Usuario desconocido" donde antes estaba mi cuenta. Creo que el UID de mi usuario cambió con la nueva instalación

Respuestas (1)

En Preferencias del sistema -> Compartir -> Inicio de sesión remoto, mi "permitir acceso para" muestra "Usuario desconocido" en "solo para estos usuarios". Esto probablemente se deba a que el UID de mi usuario cambió después de la instalación nueva. La solución es, por supuesto, asegurarse de que mi cuenta de usuario esté en la lista permitida o habilitarla para todos los usuarios.

¡Buena atrapada! Esto sin duda ayudará a alguien en el futuro...