7

我刚刚开设了一个 OpenShift 帐户,并完成了本教程:

https://www.openshift.com/blogs/any-version-of-nodejs-you-want-in-the-cloud-openshift-does-it-paas-style

当我开始创建应用程序时,出现以下错误:

erelsgl@erelsgl-H61MLC:~/mynode$ sudo rhc create-app mynode nodejs-0.6
Application Options
-------------------
  Namespace:  erel
  Cartridges: nodejs-0.6
  Gear Size:  default
  Scaling:    no

Creating application 'mynode' ... done


Waiting for your DNS name to be available ... done

Cloning into 'mynode'...
Warning: Permanently added the RSA host key for IP address '23.22.156.99' to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: The remote end hung up unexpectedly
Unable to clone your repository. Called Git with: git clone
ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/ "mynode"

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING:  Your application was created successfully but had problems during
          configuration. Below is a list of the issues and steps you can
          take to complete the configuration of your application.

  Application URL: http://mynode-erel.rhcloud.com/

  Issues:
    1. We were unable to clone your application's git repo - Unable to clone your repository.
Called Git with: git clone
ssh://522c...@mynode-erel.rhcloud.com/~/git/mynode.git/ "mynode"

  Steps to complete your configuration:
    1. Clone your git repo
      $ rhc git-clone mynode

  If you continue to experience problems after completing these steps,
  you can try destroying and recreating the application:

    $ rhc app delete mynode --confirm

  Please contact us if you are unable to successfully create your
  application:

    Support - https://www.openshift.com/support

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



Your application 'mynode' is now available.

  URL:        http://mynode-erel.rhcloud.com/
  SSH to:     522c....@mynode-erel.rhcloud.com
  Git remote: ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/

Run 'rhc show-app mynode' for more details about your app.

我试图克隆,并得到了这个:

erelsgl@erelsgl-H61MLC:~/mynode$ sudo rhc git-clone mynode
Cloning into 'mynode'...
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: The remote end hung up unexpectedly
Unable to clone your repository. Called Git with: git clone
ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/ "mynode"

编辑:我有一个 ssh 密钥:

erelsgl@erelsgl-H61MLC:~/mynode$ sudo rhc sshkey list
default (type: ssh-rsa)
-----------------------
Fingerprint: 62:...

You have 1 SSH keys associated with your account.
4

7 回答 7

6

我遇到了完全相同的问题,并在 windows 下找到了解决方案。看起来你在 Linux 下,但可能这会给你一些想法。

首先,您需要确保您的 SSL 密钥已为 Git 正确创建(请查看我博客上的这篇文章以获取说明)。

然后,使用 Git for Windows,右键单击文件夹以克隆项目并输入 SSL URL:

在此处输入图像描述

确保检查Load Putty Key并选择.ppk文件的路径。这对我来说就像一个魅力。

从命令行克隆时,您可能需要在 Linux 下指定私钥文件的路径。

于 2013-10-14T13:35:18.923 回答
5

您的错误是您在应用程序主机内克隆存储库,这将在 openshift 上克隆您的应用程序主机内的存储库,然后它授予您拒绝在主机上写入访问权限的权限,您必须在本地关闭它。

首先打开命令提示符,然后输入:

mkdir apprepo
cd /d apprepo
git clone ssh://522c....@mynode-erel.rhcloud.com/~/git/mynode.git/

如果您在存储库中有任何更改:

git commit -a
git push
于 2013-11-24T13:50:00.673 回答
3

您的 ssh 密钥似乎有问题。你在openshift上加了一个吗?你可以跑过去rhc sshkey list看看。确保这些私钥之一在您的 ssh 文件夹中,C:\user\\[username]\\.ssh\适用于 windows 和~/.sshlinux(请注意,在两个操作系统上它们都是隐藏文件夹)。Openshift 拒绝让你对 git repo 做任何事情,除非它可以验证你的 ssh 密钥。查看此Openshift SSH 文档以了解更多详细信息。

于 2013-09-08T15:45:59.890 回答
1

转到 Eclipse 和 ssh 密钥菜单中的首选项,单击 KEY MANAGEMENT 并且有一个 rsa 密钥选项卡单击它并复制您的公钥并单击按钮另存为私钥...然后转到您打开的班次应用程序并粘贴您的公共关键并努力工作......我希望它能工作

于 2014-05-29T06:20:53.817 回答
0

这似乎是回答 SSH 密钥相关问题的线程,即使与不在主机上克隆相关的答案似乎最有意义。

关于配置的密钥有利于打开 SSH 连接,但不适用于 git 克隆,我尝试了这个线程和 OpenShift 站点上的所有内容,最终发现 Git for Windows 没有使用由 Pageant 管理的 SSH 密钥;我克隆存储库的唯一方法是让 Git GUI 为我生成一个新密钥,然后将该公钥添加到我的 OpenShift 应用程序中。

我在这里发布这个答案是因为我不知道我应该在哪里,我希望它有帮助!

于 2015-02-22T23:55:02.413 回答
0

请勿sudo在创建应用或使用时使用rhc

于 2013-09-25T07:07:23.633 回答
0

I have the same problem as you, and got an idea based on ʀɣαɳĵ answer

Don't use sudo when creating your app or when using rhc

Considering this recommendation I tried deleting my app and re-creating it using my user without using sudo, but I received some permission errors indicating problems accessing:
- .openshift folder under my user home folder
- .ssh/rsa* documents under my user home folder also
- My actual directory where a new directory would be created as part of the app creation

After granting access to those resources using chmod:
- chmod 755 for both .openshift and .ssh/rsa*
- chmod -R 777 mydir in my actual directory

I re created the app (rhc create app yourAppName platform ) and everything is working fine now!

Hope it helps you.

于 2015-07-06T15:15:15.120 回答