CentOS 7では、パスワードのないSSHは機能しません。

CentOS 7では、パスワードのないSSHは機能しません。

VMWareにインストールされているCentOS7でパスワードのないSSHを試しています。私はこのステップに従います協会しかし、SSHを使用すると問題が発生しました。ログは次のとおりです。

[root@osboxes ~]# ssh root@localhost
root@localhost's password: 
Last login: Wed Sep 21 16:02:39 2016 from localhost.localdomain
[root@osboxes ~]# ssh -v root@localhost
OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /root/.ssh/config
debug1: /root/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 51: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.4
debug1: match: OpenSSH_6.4 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 1b:08:56:1a:03:c6:e9:1d:dd:bf:19:02:72:c0:1b:0f
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
debug1: ssh_ecdsa_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,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
No Kerberos credentials available

debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Next authentication method: password
root@localhost's password:

また、ファイル権限は

  • ls -lZd~dr-xr-x---
  • ls -lZd ~/.ssh drwx------
  • ls -lZd ~/.ssh/authorized_keys -rw-------

答え1

あなたの答えCentOS 7はSELinuxに依存しています。:

restorecon -Rv ~/.ssh

答え2

私の場合は、デフォルトの権限を変更したため、ホームディレクトリの権限によりパスワードのないログインが機能しませんでした。最後に、これは私にとって効果的でした。私のホームディレクトリの権限は次のとおりです。

/ホーム/ユーザー名

drwxr----x. 18 username     groupname  4096 May 11 11:52 username

/ホーム/ユーザー名/.ssh

268823097 drwx------   2 username groupname     29 May 11 11:53 .ssh

/home/ユーザー名/.ssh/authorized_keys

-rw-r----- 1 username groupname 402 May 11 11:53 authorized_keys

関連情報