I have logged in successfully via ssh to raspi3 with openhabian as openhabian@openHABianPi.
Afterwards I want to start a pythonscript with 2 parameters like:
Only when I supply the password “openhabian” (it is the default password, which I using via ssh)
the script started and is working fine.
When I started the script again, e.g. 1 minute later, no password is necessary.
Is there any solution to skirt the extra inserting of password after starting the script for the first time?
thanks for your response, but it’s not working like expect.
I have added the following row via sudo visudo and rebooted the system again,
but it’s still necessary to put in the pw for openhabian.
User privilege specification
root ALL=(ALL:ALL) ALL openhabian ALL=(ALL) NOPASSWD: ALL
Allow members of group sudo to execute any command
If openhabian is member of the group sudo, the policy would be overridden by the group policy, as this is defined after users. In fact, it is not a good idea to allow the user to execute all commands without password, it’s better to set this per command, and it’s better not to touch /etc/sudoers att all. Please take a look at /etc/sudouers, if there is a line at the bottom of the file
#includedir /etc/sudoers.d
The number sign is necessary here, this is no comment! If this line exists, you can use the directory to expand sudoers policies:
openHABianPi is the host, the line fits to, so you can limit, from which machine the user can operate.
(root) is the user, which can be used to execute the command (otherwise you could use sudo -u anyuser to execute a command as another user, not only root)
/usr/bin/python you have to expose the complete path to the command
/home/openhabian/scripts/shutter.py I’m quite sure you will have to expose the full path to the script file either
5 100 of course, you don’t need to expose the parameters, but it’s possible to do it