Search code examples
gitopenshiftgit-pushpublic-key

Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on openshift


I am having issues with committing changes to my gear. I have tried to run rhc setup, I also deleted my .ssh folder and executed rhc setup again but that also didnt work.

Not sure what changed but it worked couple of hours ago.

>git push -u <GEAR_NAME> master
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.

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

>git remote add devstage3 -f ssh://<GEAR_ID>@<GEAR_NAME>-<GEAR-DOMAIN>.rhcloud.com/~/git/<GEAR_DOMAIN>.git/ 

Also I have tried to start a different gear and commit to it but I am getting the same error:

Updating <GEAR_NAME>
The authenticity of host '<GEAR_NAME>-<GEAR-DOMAIN>.rhcloud.com (<GEAR_IP>)' can't be established.
RSA key fingerprint is <KEY_FINGERPRINT>.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '<GEAR_NAME>-<GEAR-DOMAIN>.rhcloud.com,<GEAR_IP>' (RSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch <GEAR_NAME>

Solution

  • Remove the keys: rhc sshkey-remove You can also delete them from the management console, by going to https://openshift.redhat.com/app/console/settings

    Once done, upload the public key (copy the content of your id_rsa.pub to management console) : https://openshift.redhat.com/app/console/keys/new

    Save it. After this try to git clone and it should work for you.