Can not SSH to openshift

2019-04-06 11:26发布

I have problem with accessing SSH to Openshift. I still can push code to Openshift via Git. But when trying to SSH to Openshift, the server denied with error "no supported authentication methods available (server sent: public key, gssapi-keyex, gssapi-with-mic". I'm using Windows 7.

Do you know what's the problem and how to solve it?

标签: ssh openshift
8条回答
倾城 Initia
2楼-- · 2019-04-06 11:40

Short version: remove the leading "ssh " from the ssh url provided by the OpenShift web console.

I was frustrated when this happened to me. I tried all things mentioned above. At last I gave up in windows 7 and opened my Ubuntu virtual machine. Then I noticed the leading "ssh " in the url.

查看更多
霸刀☆藐视天下
3楼-- · 2019-04-06 11:46

Reference

TOOLS

We will need two tools to work with :

  1. PuTTY
  2. PuTTYgen

METHOD

Step 1: Generate a brand-new SSH-2 RSA key.

Step 2: Add the generated key in the host (for ex. in settings >> keys on Openshift) that requires the authentication.

Step 3: Export this key from PuTTYgen Conversions >> Export OpenSSH Key and save it on your file-system

Step 4: Add/Edit your ~/.ssh/config file

// ~/.ssh/config
Host HOST_NAME // for example - https://my-domain.rhcloud.com
  Port PORT_NUMBER // ideally 22
  IdentityFile PATH/TO/FILE/CREATED/IN/STEP/3 // the path to where the key was exported

Example Configuration of ~/.ssh/config

Host cool-websites.rhcloud.com
 Port 22
 IdentityFile C:/Users/cool_dude/Desktop/rhcloud

Good Luck.

查看更多
等我变得足够好
4楼-- · 2019-04-06 11:50

This answer is for Windows users. Who used puttygen.exe to generate your RSA keys. And you added the PUBLIC key to your Openshift account, via the web console. And you can PUTTY in OK, but not SSH from GIT-BASH (or cannot git clone via SSH).

One common reason is the key generated by puttygen.exe, is a PUTTY specific file. You can convert this to OPENSSH format, from within the puttygen.exe program. (Menu > Conversions > Export OpenSSH Key) Save it to a new file, in the same directory as your original PUTTY generated PUBLIC/PRIVATE key pair.

Reference this OPENSSH key from your ~/.ssh/config file. See step 4 here, if you dont have this config file. https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git

Test by opening GIT-BASH, and trying your specific "ssh user@yourhost.rhcloud.com" (without the quotes, and where user and your host are specific to your account). If that works, you should be good to go...

查看更多
看我几分像从前
5楼-- · 2019-04-06 11:53

You need to create keys in Puttygen - https://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe. Format - SSH-2 RSA. This keys have correct format. It works.

查看更多
迷人小祖宗
6楼-- · 2019-04-06 11:55

go to preference in eclipse and in ssh key menu, click KEY MANAGEMENT and ther is a rsa key tab click that and copy your public key and click the button save as private key... then go to your open shift application and paste your public key and work on it... i hope it working

查看更多
我命由我不由天
7楼-- · 2019-04-06 11:56

You may want to reach look into what the OpenShift forums provided on no supported authentication methods available (server sent: public key, gssapi-keyex, gssapi-with-mic. The Red Hat Customer Portal also has a good article on this error, however you will need a Silver plan to see this article.

Typically, on linux this error is caused because the key you are using does not have the right permissions. In short your .ssh/id_rsa key's permissions are too lax (they should be 600).

Note that other people have seen similar issues related to this error with OpenShift so permissions may not be the root cause of your particular issue.

查看更多
登录 后发表回答