Try saving the items file again and watch the log. If there’s an error, it won’t load it and it will log the error. If it saves without error, then all I can think of is to restart OH.
Based on this, openhab is the user that is running OH and will be running the script. I do not know openhabian, but I would try running the script as that user and setup the RSA key for that account. Once that is working, the Exec binding should be able to execute the script. Or you should be able to go back to the original way without the script.
Check out the posts I linked. Your OH is running under the openhab account. That is the account that needs the permissions to run the script, or whatever else you want the Exec binding to execute.
you are probably right, and i understand that i need to change the user but i dont know how to do so i am a beginner in the command line and do not understand why the openhabian image is that confusing for beginners – i thought its the hasslefree version haha
thanks for all your ideas, links and help so far! learned a lot out of it so far thanks!
sudo : is for command as root
chown : change owner
openhab : user name
: : change group name accordingly
/etc/openhab2/scripts/iTunes2.sh : name of file to change the ownership.
What’s the exact content of iTunes.sh and iTunes2.sh?
In question of file permissions: the simple way would be to
sudo chmod 755 /etc/openhab2/scripts/iTunes.sh
to allow editing only for user openhab, but reading and execution for all users. Later, when all things work the right way, you can change the permissions to a more safe configuration.
So now the problem is reduced to the login via ssh
User username is secured via password. There is no (good) way to use password for scripted ssh. Instead you should use private keys to login. The steps for this:
Create a pair of keys either at your raspberry or at your mac with empty password (i.e. no password at all)
At your raspberry this is done with ssh-keygen
either copy the public key to your mac or copy the private key to your raspberry, depending on where you did the key creation
move the private key to /etc/openhab2/.ssh/keyfile (where keyfile is a meaningful name, e.g. name of your mac)
chmod this key file to 600 (sudo chmod 600 /etc/openhab2/.ssh/keyfile)
at your mac, change to the user profile and add the public key to your system. As I don’t own a mac, I don’t know the exact steps to place the public key, so please use google for that.