Windowsのコマンドプロンプト(公開鍵、gssapi-keyex、gssapi-with-mic)で権限が拒否されました。

Windowsのコマンドプロンプト(公開鍵、gssapi-keyex、gssapi-with-mic)で権限が拒否されました。

WindowsコマンドプロンプトでGoogle CloudでホストされているFedora VMでSSHを実行することはできません。回答を見つけるためにWebを検索しようとしましたが、Windowsの説明/解決策が見つかりませんでした。

私は次の手順を実行しました。

  1. 下の図に示すように、Google Cloud に仮想マシンを作成しました。

fedora-cloud-base-gcp-34-1-2-x86-64

  1. ファイアウォールのポート22を介して仮想マシンへのアクセスを許可します。

  2. 公開鍵と秘密鍵を生成するには、Windowsのコマンドプロンプトで次のコマンドを実行します。

    ssh-keygen -t ECDSA

  3. VMに公開鍵を追加します。

今私が走るときSSHユーザー名@ホスト.sshフォルダのコマンドプロンプトで次のエラーが発生します。

PS C:\Users\user1\.ssh> ssh -i C:/Users/user1/.ssh/id_ecdsa [email protected]
The authenticity of host '34.19.24.7 (34.19.24.7)' can't be established.
ECDSA key fingerprint is SHA256:3/NMD26H/bhz9DJYHssTcFAKEpttgpobGac.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '34.19.24.7' (ECDSA) to the list of known hosts.
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

興味深いことに、「Debian」イメージを使用して作成された同じサブネットの下の別の仮想マシンに接続できます。

この失敗の原因と解決策は何ですか?

このコマンドのPFBデバッグログ:

PS C:\Users\user1\.ssh> ssh -v -i C:/Users/user1/.ssh/id_ecdsa [email protected]
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Connecting to 34.19.24.7 [34.19.24.7] port 22.
debug1: Connection established.
debug1: identity file C:/Users/user1/.ssh/id_ecdsa type 2
debug1: identity file C:/Users/user1/.ssh/id_ecdsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.5
debug1: match: OpenSSH_8.5 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 34.19.24.7:22 as 'user1'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:3/NMD26H/bhz9DJYHssTcFAKEpttgpobGac
debug1: Host '34.19.24.7' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\user1/.ssh/known_hosts:2
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: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:/Users/user1/.ssh/id_ecdsa ECDSA SHA256:nGbnvW+SfJQfakeHcpXzw+8nJbtnqQWPNQtro+q/8 explicit
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,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering public key: C:/Users/user1/.ssh/id_ecdsa ECDSA SHA256:nGbnvW+SfJQU9fakepXzw+8nJbtnqQWPNQtro+q/8 explicit
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: No more authentication methods to try.

ベストアンサー1

おすすめ記事