SSH中に権限拒否エラーを修正する方法

SSH中に権限拒否エラーを修正する方法

Xshellを使用してAWSから新しいEC2サーバーにSSHを試みていますが、次のエラーが発生します。これは、クライアントの公開鍵がサーバー側のauthorized_keysに追加されていないことを意味しますか?どのRCAにエラーがあるかを確認して修正するにはどうすればよいですか?

[bastion-ro@ip-10-1-X-XX ~]$ ssh [email protected]
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
[bastion-ro@ip-10-1-X-XX .ssh]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)

どんなアドバイスもありがとうございます。

ベストアンサー1

サーバー側のログを確認しないと、問題を確認できません。走っている間はssh -v推測しかできません。何が間違っているのかを明確に示し、攻撃者に重要な情報を公開すると、潜在的な攻撃が容易になります。以下は例です。

debug1: Host '192.168.1.1' is known and matches the ECDSA host key.
debug1: Found key in /home/jiri/.ssh/known_hosts:30
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /tmp/test RSA SHA256:vOJarZ7K6aLtlnPvQnzx1MxA/36iV4xkubPY4PhlEKA explicit

クライアントがSSHキーを使用しようとしています/tmp/test

debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /tmp/test RSA SHA256:vOJarZ7K6aLtlnPvQnzx1MxA/36iV4xkubPY4PhlEKA explicit
debug1: Authentications that can continue: publickey,keyboard-interactive

サーバーが満足していないため表示されません。debug1: Authentication succeeded (publickey).

debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey,keyboard-interactive).

ユーザーエラー、キーの欠落、またはキーの制限が適用され、認証に失敗したかどうかはわかりません。上記の例では、ユーザーはまったく存在しません。

おすすめ記事