rhc ssh [No system SSH available] error

独自空忆成欢 提交于 2019-12-18 12:00:03

问题


I want view my openshift application log in my cmd. I did try :
rhc ssh appname

that time i am getting:

No system SSH available. Please use the --ssh option to specify the path to your SSH executable, or install SSH.

My system have already ssh key.so how can i solve that problem?


回答1:


You need to make sure:

  • you are in a cmd session where HOME is define (type set HOME to check its value: it must be C:\Users\yourLogin, because ssh needs to look for keys in %HOME%\.ssh)
  • your ssh.exe parent folder is referenced in the %PATH%, or you can type:

    rhc ssh -ssh "c:\prgs\git\PortableGit-2.8.3-64-bit\usr\bin\" -a appname
    

Replace c:\prgs\git\PortableGit-2.8.3-64-bit with the actual installation path of your Git for Windows.

The easiest solution is to add the git\usr\bin folder (which includes ssh.exe) to the PATH environment variable.




回答2:


If you installed Git for Windows1, then you can try something similar to:

rhc ssh --ssh C:\PROGRA~1\Git\usr\bin\ssh.exe -a <appname>

e.g.

rhc ssh --ssh C:\PROGRA~1\Git\usr\bin\ssh.exe -a myawesomeapp

Notes

  1. See https://git-scm.com/download/win or https://git-for-windows.github.io/



回答3:


If you are not interested in adding your git path to PATH you will need to use a 8.3 style path because rhc can't seem to handle spaces in the path.

  • For x86 versions of git use rhc ssh myapp --ssh C:\Progra~2\Git\usr\bin\ssh.exe
  • For x64 versions of git use rhc ssh myapp --ssh "C:\Progra~1\Git\usr\bin\ssh.exe

If you leave the spaces like C:\Users\me>rhc ssh myapp --ssh "C:\Program Files (x86)\Git\usr\bin\ssh.exe"

You will get the following error:

RSA 1024 bit CA certificates are loaded due to old openssl compatibility
Connecting to my0apps0guid@myapp-me.rhcloud.com ...
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-1.38.4/lib/rhc/commands/ssh.rb:49:in 'exec': No such file or directory - C:\Prog
ram (Errno::ENOENT)
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-1.38.4/lib/rhc/commands/ssh.rb:49:in 'run'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-1.38.4/lib/rhc/commands.rb:294:in 'execute'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-1.38.4/lib/rhc/commands.rb:285:in 'block (3 levels) in to_commander'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.2.1/lib/commander/command.rb:180:in 'call'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.2.1/lib/commander/command.rb:180:in 'call'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.2.1/lib/commander/command.rb:155:in 'run'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.2.1/lib/commander/runner.rb:421:in 'run_active_command'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-1.38.4/lib/rhc/command_runner.rb:72:in 'run!'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.2.1/lib/commander/delegates.rb:12:in 'run!'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-1.38.4/lib/rhc/cli.rb:37:in 'start'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-1.38.4/bin/rhc:20:in '<top (required)>'
    from C:/Ruby193/bin/rhc:23:in 'load'
    from C:/Ruby193/bin/rhc:23:in '<main>'



回答4:


Install 'SSH' client like Cygwin.

A very interesting Tutorial is->>> nawab-how-to-install-ssh




回答5:


You may want to first got to Openshift Web Console >> Settings and delete the exiting keys. Then run rhc setup in command line. Then try rhc ssh -a yourApp --ssh C:\PROGRA~1\Git\usr\bin\ssh.exe. This is what worked for me so am sharing this answer. Hope this helps. Good Luck.



来源:https://stackoverflow.com/questions/27143724/rhc-ssh-no-system-ssh-available-error

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