在openshift上被允许拒绝(publickey,gssapi-keyex,gssapi-with-mic)

时间:2014-02-03 00:21:24

标签: git openshift git-push public-key

我遇到了对我的装备进行更改的问题。我试图运行rhc设置,我也删除了我的.ssh文件夹并再次执行rhc设置,但这也没有用。

不知道发生了什么变化,但几个小时前就已经发生了变化。

>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/ 

此外,我试图启动一个不同的装备并承诺,但我得到同样的错误:

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>

12 个答案:

答案 0 :(得分:22)

如果您使用的是Windows,则可以尝试以下步骤:

  1. 查找您的ssh公钥 通常你可以在c:\\users\\YOUR_USERNAME\\.ssh

  2. 找到它
  3. 将您的openshift公钥复制到您的git的ssh-key文件夹

    假设我们在d:\\git

    中有git

    然后我们需要将公钥从c:\\users\\YOUR_USERNAME\\.ssh复制到d:\\git\\.ssh

  4. 尝试是否有效

答案 1 :(得分:17)

删除键:rhc sshkey-remove 您也可以通过转到https://openshift.redhat.com/app/console/settings

从管理控制台中删除它们

完成后,上传公钥(将id_rsa.pub的内容复制到管理控制台): https://openshift.redhat.com/app/console/keys/new

保存。在尝试git clone后,它应该适合你。

答案 2 :(得分:8)

对我有用的是使用 Git Bash

生成密钥
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

然后将密钥添加到ssh-agent,如此处所述

https://help.github.com/articles/generating-a-new-ssh-key/

答案 3 :(得分:5)

有同样的问题和浪费的时间,我正在使用centos 7.以下解决了我的问题。

在linux上:

  1. “cd /home/your_username/.ssh”
  2. 查看“id_rsa.pub”并复制内容
  3. 在openshift上从UI创建一个键并粘贴“* .pub”文件中的内容
  4. 保存新密钥
  5. 尝试从本地计算机重新连接
  6. 希望以上有所帮助。请注意,在Mac上它的工作单词只有linux游戏我的错误。

答案 4 :(得分:1)

我还建议先尝试SSH。使用SSH使用-vv标志来显示更多连接信息。我的猜测是SSH正在尝试使用与上传到服务器的密钥不同的密钥

答案 5 :(得分:1)

请检查您是否已更改为其他帐户。

我的帐户更改为root时遇到此问题。

我正在使用ubuntu。

我通过以下cmds解决了这个问题

rm ~/.openshift/ -rf
rm ~/.ssh/* -rf
rhc setup

我遇到了以下错误:

chmod: 更改".git/FETCH_HEAD" 的权限: 不允许的操作
解决方法:

sudo chmod 777 .git/FETCH_HEAD

然后:

git pull

得到:

Already up-to-date.
一切都找到了。

答案 6 :(得分:1)

你必须签入〜/ .ssh /如果存在文件id_rsa.pub和id_rsa 如果不是,你必须使用openssh创建它 或者如果存在扩展名为.pub的文件,则复制它并将副本重命名为id_rsa.pub 然后用id_rsa做同样的事情。 这项工作与谷歌计算引擎。 我试过了

答案 7 :(得分:1)

以下答案可能会有所帮助。将GSSAPIAuthentication no添加到.ssh/config

$ cat .ssh/config
Host *
  ServerAliveInterval 240
  GSSAPIAuthentication no

答案 8 :(得分:0)

我通过为ssh设置代理来解决问题: 的的〜/ .ssh /配置

ProxyCommand /bin/connect.exe -H proxy:8080 %h %p

Host rhcloud.com
User myemailasrhclogin@gmail.com
Port 22
Hostname rhcloud.com
IdentityFile "C:\users\username\.ssh\id_rsa"
TCPKeepAlive yes
IdentitiesOnly yes

SSH in git behind proxy on windows 7

我最初的错误是使用appname.rhcloud.com作为主机或主机名。是的,将公钥添加到OpenShift也是必要的。

答案 9 :(得分:0)

还要确保你的〜/ .ssh / id_rsa文件具有rhc所需的适当权限:

chmod 600 ~/.ssh/id_rsa

答案 10 :(得分:0)

我有Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
使用git clone ssh://<<repo_created_by_openshift>>进行克隆时。

应用程序是使用Openshift的网站创建的,而不是rhc app create 我的SSH密钥没问题,重新导入到Openshift没有帮助,也没有到期会话,等等。
我不想生成新密钥。

最终奏效的是: rhc git-clone -a <app_name>>代替裸git clone <<repo_address>> 您可能还必须使会话到期。

答案 11 :(得分:0)

在 Windows 上,在 Windows 凭据管理器中删除主机记录对我有帮助。之后,git 变成了我的 ssh 密钥需要密码。