通过terminal进行OpenShift访问(SSH)

我目前坐在Ubuntu上,并希望远程访问我的OpenShift应用程序。 我已经做了以下创build一个ssh-rsa键(我用xx:xxreplace了指纹):

> mkdir ~/.ssh > chmod 700 ~/.ssh > ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/karl/.ssh/id_rsa): openshiftKey Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in openshiftKey. Your public key has been saved in openshiftKey.pub. The key fingerprint is: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx karl@karllaptop The key's randomart image is: +--[ RSA 2048]----+ | | ... the rest of the image 

这会创build两个文件(注意他们不在〜/ .ssh中):

 ~/openshiftKey ~/openshiftKey.pub 

我不知道这些文件属于哪里,示例和教程没有提到移动它们。

我打开openshiftKey.pub并复制代码:

在这里输入图像说明

我把它粘贴到Openshift:

在这里输入图像说明

点击保存:

在这里输入图像说明

回到应用程序设置页面并复制ssh链接:

在这里输入图像说明

并在我的terminal上尝试连接:

在这里输入图像说明

我很抱歉,因为我在这个学位是新手,我做错了什么?

这是一个问题:

 Enter file in which to save the key (/home/karl/.ssh/id_rsa): openshiftKey 

你没有接受默认值,并给你的密钥一个特定的文件名。

如果你已经接受了默认值,那么只要你在任何地方进行远程连接,ssh都会查看这个默认位置,然后尝试使用该密钥。

为了使用除默认密钥以外的密钥,您必须在使用ssh时明确指定它,例如:

 ssh -i $HOME/openshiftKey bad-example.rhcloud.com 

但是你可能想把钥匙放在默认位置,这样你就可以使用rhc命令行工具来pipe理你的齿轮。 尝试喂它的SSH选项是…相当毛茸茸的。