質問: sshが公開鍵を受け入れない 2台のマシン間でsshキーを設定する場合、認証は一方向でのみ機能します。接続しようとすると、一方のサーバーが他方の公開鍵を受け入れません。何か案は?これが詳細な出力です。debug1: reading configuration data /usr/local/etc/ssh_config debug1: rhosts authentication disabled, originating port will not be trusted. debug1: connecting to xxxxxx.com [xx.xx.xx.xx] port 22. debug1: connection established. debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/id_rsa type 1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: remote protocol version 2.0, remote software version openssh_5.1p1 debian-5 debug1: match: openssh_5.1p1 debian-5 pat openssh* debug1: enabling compatibility mode for protocol 2.0 debug1: local version string ssh-2.0-openssh_3.6.1p2 debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit received debug1: kex: server->client aes128-cbc hmac-md5 none debug1: kex: client->server aes128-cbc hmac-md5 none debug1: ssh2_msg_kex_dh_gex_request 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 'xxxxxx.com' is known and matches the rsa host key. debug1: found key in /root/.ssh/known_hosts:17 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,password debug1: next authentication method: publickey debug1: trying private key: /root/.ssh/identity debug1: offering public key: /root/.ssh/id_rsa debug1: authentications that can continue: publickey,password debug1: trying private key: /root/.ssh/id_dsa debug1: next authentication method: password 編集:重要な場合、これはroot用です
回答: .sshフォルダー、authorized_keyファイル、およびホームフォルダーのアクセス許可と所有者を確認してください。ログインしようとすると、/ var/log /auth.logからさらに多くのメッセージが表示されます。