Java – Apache Felix Shell Using SSH

How do I use Apache Felix and SSH? I want to use SSH to access Felix shell from a remote computer I know there is a telnet support, but it's too insecure Is there any solution?

Solution

Yes, there is one. As described here (the guide is relative to eclipse's equinox, but it doesn't matter). Using the combination of gogo shell, Apache Mina sshd server and three equinox console bundles (the core SSH plug-in JAAS plug-in for SSH authentication), you will be able to connect to Mina's SSH server, and your OSGi related commands will be executed by gogo shell

You need these bags:

> GoGo Shell:org. apache. Felix. gogo. command. jar,org. apache. Felix. gogo. runtime. jar,org. apache. Felix. gogo. shell. Jar > equinox console bundle: 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 > and record slf4j API Jar and slf4j API_ impl. jar

As described here, you also need these attributes in the Felix configuration file:

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

Equinox JAAS package will search for org eclipse. equinox. console. authentication. Config file, which will enable the login module:

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

I'm not sure where to search with Felix (I'm not sure it's done in the standard OSGi way), but the conf directory is a good guess

The user equinox / equinox already exists. You can use the console commands provided to create other users

Edit: for equinox console / supportability package, you can get Mars version from here extension additional package section:

org. eclipse. equinox. console_ 1.1. 100.v20141023-1406. jar

You also need the supportability bundle from here (the last version was 2011)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>