I am attempting to develop a script that upgrades my VMs on a local network. The goal is for each VM to download the script and then execute it.
I have been able to use curl to download the script and execute, but I still receive a prompt to enter the password for sudo.
sshpass -p 'password' ssh -t -t [email protected] 'curl -s 192.168.1.15/upgrade.sh | sudo sh'
But I still have to enter a password again when it reaches the sudo command.
sshpass -p 'password' ssh -t -t [email protected] 'curl -s 192.168.1.15/upgrade.sh | echo 'password' | sudo sh'
Which prompts the following:
[sudo] password for aaron: (23) Failed writing body
What can I do to pass the password to the sudo password prompt?