LoginSignup
17
10

More than 5 years have passed since last update.

AWSのCodeCommitでPermission deniedが出て困った話

Posted at

AWSのCodeCommitを使ってみたら手順通りした(つもり)なのにエラーが出て怒られた話。

通常の手順等はこちらを見てください。
https://qiita.com/3utama/items/04994efa9a79d7aa36e6

で、今回ハマったのはgit pushとかした時に以下エラーが出ました。

$ git push tentatsu master
Enter passphrase for key '/Users/hoge/.ssh/code_commit_key':
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

あれー?なんでだと思ったら、.ssh/configの指定が間違っていたらしい。

Host git-codecommit.*.amazonaws.com
  User 1234567890ABCDEFGHIJK  # SSH Key ID
  IdentityFile ~/.ssh/id_rsa  # 秘密鍵のパス

このSSH Key IDというのが勘違いしやすい。
AWSのアカウント名かと思ったら、IAMで見れる以下の赤囲みの部分のことでした。

スクリーンショット 2017-09-25 9.49.14.png

17
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
10