1

when I try to clone my private repository from bitbucket to my ec2 instance using ssm agent I get

Permission denied (publickey).
fatal: Could not read from remote repository.

after invistagation I found that ssm command for some resone cant see any of my public keys in ~/.ssh/ , how to git clone from bitbucket using ssm ?

Mohamed Adel
  • 1,980
  • 17
  • 23

1 Answers1

0

The problem was that SSM or any command like startup commands when machine run as root and what I found that root doesn't have permissions to read or any access to ssh public and private keys.

So my solution "I think it is work around but work for me"

  • Change current user to root sudo su
  • Go to shh directory cd .ssh
  • copy key files or regenerate ssh keys here
Mohamed Adel
  • 1,980
  • 17
  • 23