【问题标题】:Apache Felix shell with SSH带有 SSH 的 Apache Felix shell
【发布时间】:2015-08-15 21:28:27
【问题描述】:

我对如何将 Apache Felix 与 SSH 结合使用感兴趣?我想使用 SSH 从远程计算机访问 Felix shell。我知道有 telnet 支持,但它太不安全了。有什么解决办法吗?

【问题讨论】:

    标签: java osgi apache-felix gogo-shell


    【解决方案1】:

    是的,有一个,如here 所述(该指南是相对于 Eclipse 的春分但没关系)使用gogo shellapache mina sshd 服务器和三个equinox console bundles 的组合(核心+ssh plugin+jaas ssh 认证插件),您将能够连接到 mina 的 ssh 服务器,并且您与 OSGi 相关的命令将由 gogo shell 执行。

    您将需要这些捆绑包:

    • GoGo Shell:org.apache.felix.gogo.command.jar、org.apache.felix.gogo.runtime.jar、org.apache.felix.gogo.shell.jar
    • Equinox 控制台包:org.eclipse.equinox.console.jar、org.eclipse.equinox.console.supportability.jar、org.eclipse.equinox.console.jaas.fragment.jar
    • Apache Mina:org.apache.mina.core.jar、org.apache.sshd.core.jar
    • 用于记录 slf4j-api.jar 和 slf4j-api_impl.jar

    here 所述,您还需要在 Felix 配置文件中使用这些属性:

    osgi.console.enable.builtin=false 
    osgi.console.ssh=<port> 
    osgi.console.ssh.useDefaultSecureStorage=true 
    

    Equinox JAAS 包将搜索org.eclipse.equinox.console.authentication.config 文件,该文件将启用登录模块:

    equinox_console { 
        org.eclipse.equinox.console.jaas.SecureStorageLoginModule REQUIRED; 
    }; 
    

    我不太确定会在哪里使用 Felix 进行搜索(我不确定这是以标准 OSGi 方式完成的),但 conf 目录是一个不错的猜测。

    用户 equinox/equinox 已经存在,可以使用提供的控制台命令创建其他用户。

    编辑: 对于 Equinox 控制台/可支持性捆绑包,您可以获取 Mars 版本 from here 扩展附加捆绑包部分:

    org.eclipse.equinox.console_1.1.100.v20141023-1406.jar

    你还需要supportability bundle,你可以得到from here(最后一个版本是2011年的)。

    【讨论】:

    • 我设法创建了这个dropbox.com/s/rkd9phus29yb3dd/server.zip?dl=0,但我收到了这个错误:pastebin.com/XhihQDcb
    • missing requirement [org.apache.mina.core [1](R 1.0)] osgi.wiring.package; (&amp;(osgi.wiring.packa ge=org.slf4j) 你需要用于记录的 slf4j jars。
    • 我解决了这个问题。 dropbox.com/s/a7gyz1bd29yhan7/server_2.rar?dl=0但是有一个新问题:org.osgi.framework.BundleException: Unable to resolve org.eclipse.equinox.console
    • 对于每个“无法解决”/“缺少的要求”,您必须安装包含该包的库的 jar,在这种情况下,Equinox 控制台包 org.eclipse.equinox.console.jar。有点难找,我正在更新我的答案。
    猜你喜欢
    • 2014-01-08
    • 2020-09-29
    • 2013-10-16
    • 2014-12-19
    • 1970-01-01
    • 1970-01-01
    • 2015-08-28
    • 1970-01-01
    • 2019-01-28
    相关资源
    最近更新 更多