Is a bad idea (as explained in the linked thread). Please be aware, that with this line, the user openhab is able to destroy all data on the SD card within micros of seconds. A simple
rm -rf /
Will suffice.
Please be aware that openHAB is not hardened against any attacks.
Please, when setting up a sudoers file with NOPASSWD, always ensure that only the commands are allowed, which are needed.
Switch item=SystemCmndKodi label="Kodi []" mappings=["shutdown now -r"="REBOOT","shutdown now"="OFF"]
When i check the output of this exec it looks like the command is missing in the sudoers file(sorry its german but its the same like in the linked thread):
Wir gehen davon aus, dass der lokale Systemadministrator Ihnen die
Regeln erklÀrt hat. Normalerweise lÀuft es auf drei Regeln hinaus:
#1) Respektieren Sie die PrivatsphÀre anderer.
#2) Denken Sie nach, bevor Sie tippen.
#3) Mit groĂer Macht kommt groĂe Verantwortung.
sudo: Kein TTY vorhanden und kein »askpass«-Programm angegeben
Wir gehen davon aus, dass der lokale Systemadministrator Ihnen die
Regeln erklÀrt hat. Normalerweise lÀuft es auf drei Regeln hinaus:
#1) Respektieren Sie die PrivatsphÀre anderer.
#2) Denken Sie nach, bevor Sie tippen.
#3) Mit groĂer Macht kommt groĂe Verantwortung.
sudo: Kein TTY vorhanden und kein »askpass«-Programm angegeben to
Is there a way to exactly see the command that exec tries to execute?
i activated the binding log but i cant se any details
with sudoers no password for all its all working. I cant find an difference to the working octopi command except its libreelec instead of raspian
with result âHost key verification failedâ, i think because of denied permission, because thats what the terminal telling me. I copied the key to the folder of cause.
Would be handsome to use without sudo and edit of sudoers
I also added -tt so ssh because of error âPseudo-terminal will not be allocated because stdin is not a terminalâ
which works from terminal but again not from exec binding where i get again âHost key verification failed.â. Sadly my linux skills are too low level to understand how to fix this, sounds like it could work
[rossko57] regarding the acknowledge, it doesnt seem to affect anything, but im not sure if i understand what to do. i should only use this command from terminal once i get the error? because next try it comes again (except i edit sudoers file to ALL)
this didnt work for me but i think i found a solution for the ssh commands.
I understood âsudo -u openhabâ is just to test the desired exec commands in terminal so I removed it everywhere.
Then i generated a ssh key at default location with default name and copied it by ssh, both with prefix âsudo -u openhabâ. Im not sure but i guess the default ssh key folder has the correct permissions.
After this i was able to execute the ssh login with
sudo -u openhab ssh root@kodi
and without any password.
I thougth this will be a easy upgrade
Much thanks to all of you! I learned a lot and its so cool to monitor and control all other raspberrys at home from openhab
Well, in the Terminal everything works. Just what I understood from the Binding documentation was to test in terminal with sudo -u openhab.
Iâm logged into ssh with openhabian and what was working in the Terminal was not working with exec as described in this thread. so there seems to be a difference but I donât know in detail