[Solved] executeCommandLine script issue

As opus pointed out, the problem is almost certainly caused by the fact that OH is running as the openhab user, not the openhabian user. It is standard practice on Linux to give services their own limited access user to run under.

Consequently, you will need to set up your ssh keys in ~openhab/.ssh and make sure they are owned by the user openhab and have only user read permissions.

To see the result from running executeCommandLine, you need to use the call that has the number as the second argument. But what you are missing is that the result is returned by executeCommandLine. So what you want to see the error is:

val results = executeCommandLine("rmt_cmd 'logger Test'", 5000)
logInfo("ExecTest", results)

That will likely show you the error you are getting from ssh.

See

1 Like