Domanda

Sto cercando di eseguire uno script bash che ha:

ssh -l <username> <compname> 'sudo yum -y install expect'

ottengo l'errore:

sudo: sorry, you must have a tty to run sudo

su alcuni computer, ma su altri il processo scorre liscio. Come posso evitare questo?

È stato utile?

Soluzione

Utilizzare il flag -t per forzare un tty da assegnare:

ssh -t -l <username> <compname> 'sudo yum -y install expect'
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top