简体   繁体   English

openshift 上的权限被拒绝(publickey、gssapi-keyex、gssapi-with-mic)

[英]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.我试图运行 rhc setup,我也删除了我的 .ssh 文件夹并再次执行 rhc setup 但这也不起作用。

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>

if you are using Windows, you can try the following steps:如果您使用的是 Windows,您可以尝试以下步骤:

  1. look for your ssh public key usually you can find it at c:\\\\users\\\\YOUR_USERNAME\\\\.ssh查找您的 ssh 公钥,通常您可以在c:\\\\users\\\\YOUR_USERNAME\\\\.ssh找到它

  2. copy your openshift public key to your git's ssh-key folder将您的 openshift 公钥复制到您的 git 的 ssh-key 文件夹中

    suppose we have git in d:\\\\git假设我们在d:\\\\git

    then we need to copy the public key from c:\\\\users\\\\YOUR_USERNAME\\\\.ssh to d:\\\\git\\\\.ssh然后我们需要将公钥从c:\\\\users\\\\YOUR_USERNAME\\\\.ssh复制到d:\\\\git\\\\.ssh

  3. try if it works试试看是否有效

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删除密钥:rhc sshkey-remove 您也可以通过访问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完成后,上传公钥(将您的 id_rsa.pub 的内容复制到管理控制台): https : //openshift.redhat.com/app/console/keys/new

Save it.保存。 After this try to git clone and it should work for you.在此之后尝试git clone ,它应该适合你。

what worked for me was to generate the keys using Git Bash对我有用的是使用Git Bash生成密钥

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

and then add the key to ssh-agent as described here然后按照此处所述将密钥添加到ssh-agent

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

Had the same issue and wasted hours, I'm using centos 7. The following solved my problem.有同样的问题并浪费了时间,我使用的是 centos 7。以下解决了我的问题。

On linux:在 Linux 上:

  1. "cd /home/your_username/.ssh" “cd /home/your_username/.ssh”
  2. View "id_rsa.pub" and copy contents查看“id_rsa.pub”并复制内容
  3. On openshift create a key from the UI and paste the contents from your "*.pub" file在 openshift 上从 UI 创建一个密钥并粘贴“*.pub”文件中的内容
  4. Save your new key保存您的新密钥
  5. Try reconnecting from your local machine尝试从本地机器重新连接

Hope the above helps.希望以上有帮助。 Note, on mac it worked from the word go only linux game me errors.请注意,在 mac 上,它从 go only linux game me errors 这个词开始工作。

I would also recommend trying to SSH in first.我还建议先尝试 SSH。 With SSH use the -vv flag to show more of the connection information.对于 SSH,使用 -vv 标志来显示更多连接信息。 My guess is that SSH is trying to use a different key than what you uploaded to the server我的猜测是 SSH 正在尝试使用与您上传到服务器的密钥不同的密钥

please check if you have changed to another account.请检查您是否已更改为其他帐户。

i encountered this problem when my account changed to root.当我的帐户更改为 root 时,我遇到了这个问题。

I am using ubuntu.我正在使用 ubuntu。

I solved this problem by the following cmds我通过以下命令解决了这个问题

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

and i encountered the following error:我遇到了以下错误:

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

solved by :解决了:

sudo chmod 777 .git/FETCH_HEAD

then:然后:

git pull

got:得到了:

Already up-to-date.

everything goes find.一切去寻找。

you have to check in ~/.ssh/ if exists a file id_rsa.pub and id_rsa if not you have to create it using openssh or if exists a file with extension .pub duplicate it and rename the copy as id_rsa.pub then do the same with id_rsa.您必须检查 ~/.ssh/ 如果存在文件 id_rsa.pub 和 id_rsa 如果不存在则必须使用 openssh 创建它或者如果存在扩展名为 .pub 的文件复制它并将副本重命名为 id_rsa.pub 然后执行与 id_rsa 相同。 this work with google compute engine.这项工作与谷歌计算引擎。 I've tried我试过了

The following answer might be helpful.以下答案可能会有所帮助。 Add GSSAPIAuthentication no into .ssh/configGSSAPIAuthentication no添加到.ssh/config

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

I fixed the problem by setting up proxy for ssh: ~/.ssh/config我通过为 ssh 设置代理解决了这个问题: ~/.ssh/config

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 在 Windows 7 上的代理后面的 git 中的 SSH

My initial mistake was to use appname.rhcloud.com as Host or Hostname.我最初的错误是使用 appname.rhcloud.com 作为主机或主机名。 And yes, adding your public key to OpenShift is also necessary.是的,将您的公钥添加到 OpenShift 也是必要的。

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

chmod 600 ~/.ssh/id_rsa

I had Permission denied (publickey,gssapi-keyex,gssapi-with-mic)我的Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
when cloning with git clone ssh://<<repo_created_by_openshift>> .使用git clone ssh://<<repo_created_by_openshift>>时。

App was created with Openshift's website, not with rhc app create .应用程序是使用 Openshift 的网站创建的,而不是使用rhc app create
My SSH key was ok, reimporting it to Openshift didn't help, nor did expiring sessions, and so on.我的 SSH 密钥没问题,将其重新导入 Openshift 没有帮助,会话过期等也没有帮助。
I didn't want to generate a new key.我不想生成新密钥。

What finally worked was using:最终有效的是使用:
rhc git-clone -a <app_name>> instead of bare git clone <<repo_address>> . rhc git-clone -a <app_name>>而不是裸git clone <<repo_address>>
You may have to expire sessions as well.您可能还必须使会话过期。

On Windows, removing host record in Windows Credential manager helped me.在 Windows 上,删除 Windows 凭据管理器中的主机记录对我有帮助。 After it, git became require password of my ssh key.之后,git 成为我 ssh 密钥的要求密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM