I would like to create a simple script to download and install a program over ssh.
#!/bin/bash
echo "Welcher Rechner?"
read nummer
echo "Verbinde zu APC "$nummer
apc=apc$nummer.local
sshpass -f .pass_file scp $HOME/autoconfig/.filius_update.sh dvadmin@$apc:$HOME/
sshpass -f .pass_file scp $HOME/autoconfig/filiusurl dvadmin@$apc:$HOME/
sshpass -f .pass_file scp $HOME/autoconfig/.pass_file.sh dvadmin@$apc:$HOME/.pass_file.sh
sshpass -f .pass_file ssh dvadmin@$apc 'export SUDO_ASKPASS=${HOME}/.pass_file.sh; sudo -A chmod +x ./.filius_update.sh && ./.filius_update.sh'
sshpass -f .pass_file ssh dvadmin@$apc 'export SUDO_ASKPASS=${HOME}/.pass_file.sh; sudo -A rm ./.pass_file.sh && rm filius.deb && rm filiusurl && rm .filius_update.sh'
But the terminal send me an error that I have to configure askpass:
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: A password is required
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: A password is required
I don't understand what did I wrong.
Thank you in advice.