使用 SSH 的 Apache Felix shell

Apache Felix shell with SSH

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

是的,有一个,正如所描述的here (the guide is relative to eclipse's equinox but it doesn't matter) using a combination of gogo shell, apache mina sshd server and three equinox console bundles(core+ssh插件+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 console/supportability 捆绑包,您可以获得 Mars 版本 from here 扩展部分 Add-on Bundles:

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

您还需要 supportability bundle that you can get from here(最新版本是 2011 年)。