How to pass a password in the exec node

I need to send a command like
sudo openport 1234 with a exec node
When I run this command in the terminal, I'm asked for the user password.

How can i pass this password in the exec node?

You'll have to tell your os not to use a password for that specific command, here are some hints:

Thanks for this hint, but I would prefer not to chnage anything in the config files.
Is there any other way to add a password to a sudo command with the exec node (or with an other node)?

I do not believe that is possible. The only way is to tell the OS that the node red user does not need to enter a password for the command you require to run.

1 Like

This page seems to have some tips:

Security wise this is very bad though...

I never knew you could do that, so yes
sudo 'thepassword' | sudo -kS command
does appear to work. However your system password will exist as plain text in a file, which is a very bad idea. Much better to tell the system that you don't need a password just for the commands you require, so at least you are limiting the damage that can be done.