SSH 経由で AWS Amazon サーバーにログインしようとすると、「権限の拒否 (公開キー)」エラーが発生します。

SSH 経由で AWS Amazon サーバーにログインしようとすると、「権限の拒否 (公開キー)」エラーが発生します。

端末から ssh -i /path/to/pem_file.pem を介して Amazon サーバーにログインしました。[Eメール保護]。私はうまくいきましたが、ec2 /フォルダにログファイルが多すぎてコマンド(find . -file_name_to_delete_all_series "*" -delete)を使用して削除しようとしましたが、突然すべてのファイルが削除されたことを確認し、ファイルを削除できなくなりました。上記のSSHログインコマンドを使用してサーバーに接続すると、「権限が拒否されました(公開鍵)」というエラーが表示されます。

-vで打つと表示されます

$ ssh -i /path/pem.pem [email protected] -v

OpenSSH_6.7p1 Ubuntu-5ubuntu1.4, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to ec2-my_server port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /pem_file.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file /pem_file.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Ubuntu-5ubuntu1.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
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 34:77:b9:f0:87:6b:e8:c7:31:90:92:7c:a3:b5:4b:58
debug1: Host 'ec2-server.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/apps/.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: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /pem_file.pem
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

すべてのファイルがec2 /フォルダから削除されたようで、このエラーが発生しました。

どんな助けでも大変感謝します。

ベストアンサー1

探すとはどういう意味ですか? - すべてのシリーズファイル名「*」が削除されます。 -削除

"-file_name_to_delete_all_series"オプションが見つかりません...つまり、-name name-of-the-files-I-want-to-delete "*"を意味します。

"." (ドット) とともに find コマンドを使用すると、作業ディレクトリから強制的に検索されます。どのログファイルを削除したいのかをより具体的に教えてください。

残念ながら公開鍵を削除したようです...だから... sshは不可能です! !乾杯フランシスコ

おすすめ記事