En primer lugar, quiero decir que he intentado todo en esta pregunta aquí, y no me ayudó: ¿Cómo SSH a localhost sin contraseña?
Tuve un problema de permisos de archivos recientemente porque no sé cómo Linux en el que escribí chmod 700 -R /home
, porque soy un tonto. Eso podría tener algo que ver con mi problema hoy. Alguien me ayudó a solucionar ese problema, pero pensé que lo mencionaría porque SSH es muy terco con los permisos de archivos.
Aquí está el registro de salida detallado de SSH:
[user@centos ~]$ ssh -v localhost
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/identity type -1
debug1: identity file /home/user/.ssh/identity-cert type -1
debug1: identity file /home/user/.ssh/id_rsa type 1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type 2
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
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: Host 'localhost' is known and matches the RSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:7
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_500' not found
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_500' not found
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Unspecified GSS failure. Minor code may provide more information
Credentials cache file '/tmp/krb5cc_500' not found
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/identity
debug1: Offering public key: /home/user/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Offering public key: /home/user/.ssh/id_dsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Next authentication method: password
user@localhost's password:
Aquí están los permisos de archivo para el directorio .ssh, así como su contenido:
drwx------. 2 user user 4096 Jul 7 08:52 .ssh
drwx------. 2 user user 4096 Jul 7 08:52 .
drwxrwxr-x. 44 user user 4096 Jul 7 08:43 ..
-rw------- 1 user user 2183 Jul 7 08:52 authorized_keys
-rw------- 1 user user 672 Jul 7 08:52 id_dsa
-rw-r--r-- 1 user user 603 Jul 7 08:52 id_dsa.pub
-rw-------. 1 user user 1675 Jul 2 10:55 id_rsa
-rw-r--r--. 1 user user 395 Jul 2 10:55 id_rsa.pub
-rw-r--r-- 1 user user 2733 Jul 2 10:45 known_hosts
EDITAR: Alguien preguntó por el contenido de / var / log / secure, así que aquí están. Eliminé mi nombre de usuario, ya que es mi nombre real.
Jul 7 08:53:21 centos sshd[2611]: pam_unix(sshd:session): session opened for user *USERNAME REMOVED* by (uid=0)
Jul 7 08:55:25 centos sshd[2648]: Authentication refused: bad ownership or modes for directory /home/*USERNAME REMOVED*
Jul 7 08:55:25 centos sshd[2648]: Authentication refused: bad ownership or modes for directory /home/*USERNAME REMOVED*
Jul 7 08:56:59 centos sshd[2649]: Connection closed by ::1
¿Alguien me puede ayudar?