I'm trying to run a bash script that has:
ssh -l <username> <compname> 'sudo yum -y install expect'
I get the error:
sudo: sorry, you must have a tty to run sudo
on some computers but on others the process runs smooth. How can I prevent this?
Use the -t
flag to force a tty to be allocated:
ssh -t -l <username> <compname> 'sudo yum -y install expect'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With