I'm having a problem across platforms (Pantheon, Platform.sh) where I have scripts that are set up to clone public repositories in public projects — and the scripts are failing saying that permission is being denied based on the public key. When I add the public key to my organization, then the clone succeeds. However, there are certain contexts in which I won't know the public key ahead of time. What gives?
The SSH protocol requires both the client and the server to authenticate before sending any requests and Bitbucket Cloud only supports public key authentication. When you use SSH, authentication is always required for both public and private repos.
If you want to use SSH, you will need to set up SSH keys in order for the clone operation to work. The private SSH key needs to be on the machine that performs the clone operation and the public key should be added either as an Access key to the repos, or to a user with access to the repos. It is also possible to add the public SSH key to the workspace that owns the repos, but we advise using this option with caution, as in this case, we cannot track which user performed a certain operation.
If for whatever reason, it is not possible to set up SSH (in time), another option is to use HTTPS to clone, which will not require authentication for public repos.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.