How to pass password by command (supervisor)?

0

I am executing a command on the supervisor, but in order to execute it, I need access to a file. To access this file I must be logged in the user autossh . But sometimes the ubuntu asks for the password and this can be a problem for me.

[program:long_script]
command=sudo su autossh -s /bin/bash && 
        cd /home/autossh/.ssh && 
        ssh -L5422:localhost:5422 -N -i id_autossh-pgslave1 10.0.0.2
autostart=true
autorestart=true
stderr_logfile=/var/log/long.err.log
stdout_logfile=/var/log/long.out.log

Is there a way to pass the password on the command if it is requested? (I know this is not safe, but is there another way?)

    
asked by anonymous 02.05.2018 / 17:02

0 answers