Mobaxterm - 権限が拒否されました (Publickey)

Mobaxterm - 権限が拒否されました (Publickey)

mobaxterm 経由で AWS の Linux インスタンスに接続する際に問題が発生しています。サーバーに SSH 接続しようとすると、次のエラーが発生します。


[2018-02-16 10:07.57]  ~
[bunde.DESKTOP-A0APQ1T] ➤ ssh -v -i "XYZ.pem" servername.eu-west-2.compute.amazonaws.com
OpenSSH_7.1p2, OpenSSL 1.0.1g 7 Apr 2014
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to servername.eu-west-2.compute.amazonaws.com [x.x.x.x] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /var/keys/.10996.ssh type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/keys/.10996.ssh-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to servername.eu-west-2.compute.amazonaws.com:22 as 'bunde'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 [email protected]
debug1: kex: client->server aes128-ctr hmac-sha1 [email protected]
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256: ...
debug1: Host 'servername.eu-west-2.compute.amazonaws.com' is known and matches the RSA host key.
debug1: Found key in /home/mobaxterm/.ssh/known_hosts:1
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: pubkey_prepare: ssh_fetch_identitylist: agent refused operation
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /var/keys/.10996.ssh
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
**Permission denied (publickey).**

何かアイデアはありますか? ファイルのアクセス許可をいろいろ試してみましたが (Mac ではキーをしっかりとロックダウンする必要があることはわかっています)、変更を加えてもエラーには影響がないようです。

答え1

問題はファイルの権限にあるようです。ssh コマンドを実行しようとしているフォルダーにキーが配置されていることを mobaxterm で確認できますか?

ls -lhMobaxterm コンソールから を実行し、 XYZ.pemmobaxterm を実行しているユーザーの所有者とグループ、および権限 600 (-rw-------) でファイルが存在することを確認します。

私はMACの専門家ではありませんが、デフォルトでSSHクライアントが搭載されているはずです。これを見てください。リンク

答え2

Mobaxterm をアンインストールします。プログラムの下以外の場所に再インストールしてください。そこには書き込みアクセス権がないため、です。

関連情報