Ok, thank you. You are right. I was mixing up users between the ‘Openhabian’ device and the Synology server.
What I did and finally works:
- As said @Mark_Vitarius, The executeCommandLine needs to pass all the “words” of the command as an argument (what they actually are when you type a command).
- Still as @Mark_Vitarius said, I copied (it was already generated) the ssh keys to the synology by typing
sudo -u openhab ssh-copy-id openhab@xxx.xxx.xxx.xxx
what forces the user openhab from the openhabian device to copy his ssh keys to the openhab user on the Synology.
- As the thread you kindly mentioned, I had to add the user openhab (from the Openhabian device) to the sudoers with no password.
Thank you for your help @Lionello_Marrelli. I lost a whole day trying unsuccessfully, and your help allowed me to accomplish it in just an hour.