Unable to login to Openshift

纵然是瞬间 提交于 2019-12-03 06:27:34

When your got

SSH connection could not be established to myapp-mydomain.rhcloud.com. Your SSH configuration may not be correct, or the application may not be responding. Could not parse PKey: no start line (ArgumentError)

just delete ssh keys id_rsa from .ssh directory and than run rhc setup it will create new one for you with the same name.

The similar problem was solved by changing the net-ssh gem

 gem uninstall net-ssh

and then install a stable version. I would suggest to avoid beta versions. because 2.9.3.beta was giving me this problem and now 2.9.2 working just fine.

gem install net-ssh -v 2.9.2

and also try to remove the old key, because there could be a possibility that public key is modified by another application or account.

I can solve removing /Users/myuser/.ssh/id_rsa directory and running rhc setup

Had the same problem as described by OP. Interestingly, at first everything worked (git, rhc ssh, putty). And from one day to another the problem occured.

Neither creating new rsa keys nor installing another net-ssh version as described in one of the answers helped.

Finally I removed my application with help of the openshift web console and created it new. Now (using the rsa keys that didn't work before) git and putty work fine while rhc ssh still yields the error message "The server did not respond correctly."

rhc ssh yourapplicationname

instead.

It is asking for the password that you created for you SSH Private Key file, not your openshift password. Either make sure that you are entering that password, or create a private key file that does NOT use a password.

The only way that this worked for me was to actually create a SSH key locally with ssh-keygen -p without rhc setup and "not" giving it a password. I then went back to OpenShift clicked add a key and pasted the contents of my rsa file.

There is obviously some kind of bug with authentication on Openshift or the installation is not right.

I suspect one of two things is going on.

  1. The key you are trying to use from /Users/myuser/.ssh/id_rsa may be an ssh V2 key. If you created this on a Mac, it can be configured to create either V1 or V2 by default. OpenShift isn't AFAIK configured to support V2 keys. I would expect ssh-keygen -t rsa to create V1 keys.

  2. Your use of sudo rhc is confusing things. Commands run by sudo run as root, while commands without it run as your user. Above rhc setup appeared to still be accessing your user's ssh key, so I am not certain it's related, but there should be no need for root access. Your comments elsewhere indicate rvm is in use. Try rvm use system so that you can run rhc setup as your user against the system gems (which is most likely where the rhc gem is installed).

I could overcome same problem by generating rsa key on my own as root, in the terminal run: ssh-keygen. Asks for a passphrase, then it generates the keys. When done, open the public key at /root/.ssh/id_rsa.pub, copy its content and paste it in openshift panel under Settings -> Add new key... button. Then run rhc ssh appname and will ask for your passphrase and work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!