EC2 に Linux AMI をセットアップしました。デフォルトのユーザーは ec2-user です。インスタンスに 2 番目のユーザー アカウントを作成しました。ec2-user ホーム ディレクトリから .ssh/authorized_keys ファイルを新しいユーザーのホーム ディレクトリにコピーしました。.ssh/ の権限を 700 に、authorized_keys の権限を 600 に設定しました。'chown' を実行して、.ssh/ フォルダーの所有者を新しいユーザーに設定しました。しかし、新しいユーザーとしてログインすると、'Permission denied (publickey).' というメッセージが表示されます。ssh -v -i を実行したときに表示される内容は次のとおりです。
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: testami-key.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
これを修正するにはどうすればいいでしょうか? ありがとうございます。
答え1
authorized_keys ファイルも新しいユーザー名に chown しましたか? .ssh ディレクトリの chown についてのみ言及しました。


