I have a script fixa.sh deployed in all my client machine. I want to run this script from my jump host through a for loop script. Script on execution, prompts for sudo password. How can i make it as non interactive execution on jump host just be reading the password while executing.

I know if it is a sudo command i can make execute like

echo -n password: 
read -s password
ssh -t hostname 'echo $password | sudo -s <Command>'

But not sure how can i make the same way to execute script.


1 Answer 1


If you're fine with compromising the security a little, change the sudoers rule such that it doesn't prompt for password.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .