So, I've been using composer to manage my git repos (on bitbucket) and now, out of the blue composer complains about me not having access to my repos :S
I haven't done anything in particular. But I went ahead and generated a new key using ssh-keygen
, copied the public key and added it to my bitbucket account.
So I tried sudo composer update
again, and it still complains:
Failed to update [email protected]:afflicto/event.git, package information from this repository may be outdated (Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch origin
)
What could be wrong?
Update
I just pushed to one of my git repos, and it works fine. So it seems the SSH Key is setup correctly but Composer is doing something strange.
Update 2
It seems that running composer update
as sudo
(i.e sudo composer update
) will not use your ssh keys... so I have to add my SSH keys to the root user I suppose? :\
sudo -E
though, that's neat! – Randalrandall