Stuck with Exec and sudo

#1

Hello, i'm running node-red on an orange-pi, it is running armbian with the diet-pi scripts ontop.

I've slowly built up flows that i am happy with, and i started trying to use some exec nodes.

For some nodes it is ok, but for anything using sudo, i get the message We trust you have received the usual lecture from the local System↵Administrator. It usually boils down to these three things:↵↵ #1) Respect the privacy of others.↵ #2) Think before you type.↵ #3) With great power comes great responsibility.↵↵sudo: no tty present and no askpass program specified↵"

I've tried to add the user nodered to visudo, but it doesn't seem to have helped.

Please can someone point me gently in the right direction?

#2

You need the following - I have it in /etc/sudoers.d/010_pi-nopasswd:

pi ALL=(ALL) NOPASSWD: ALL

You will need to change pi to whatever your device is using as a user. You should test it from the command line first.

Obviously it is more secure to put specific commands in there rather than using ALL.

#3

Thanks so much for the pointer, that's done it. perfect, thanks!!!!!