I am running OpenHAB version 4 in a Docker environment and need to connect to an older device that has SSH and Telnet ports open. Occasionally, I need to execute commands via SSH or Telnet on this device.
I found some older forum discussions suggesting different approaches:
• Some recommend executing SSH commands directly via the command line.
• Others mention the existence of a Denon binding that allows sending Telnet commands.
However, these discussions are quite outdated, and some bindings (like TCP) no longer seem to be available in OpenHAB 4.
Additionally, since I am running OpenHAB in a Docker container, SSH and Telnet are not natively installed. Ideally, I’d prefer a binding that offers this functionality rather than modifying the container manually.
What would be the best way to achieve this in OpenHAB 4? Is there a recommended binding or workaround?
There are many ways to do ssh. I have never looked into telnet but if Denon binding supported it, it probably still does.
For docker, you can install ssh by mounting cont-init.d into your docker, and adding a script to install ssh. I do this on mine. I’ve just posted instructions to do it here: Script connect via ssh and run command - #16 by jimtng
Another way is to use jruby and install a ruby native ssh client. It’s not hard to do, but I’d say installing a standard ssh client mentioned above is the “easiest”, especially if you aren’t already using jruby for other things.
As I really just need an ssh or Telnet connection with nothing else (no Denon device) I guess I’ll use the ssh command option. As Itjink it might be the most long term compatible one.