I am trying to write a program to perform remote administration of a system. To this end, I issue SSH commands and provide input programmatically via a pipe. I also capture their output.
Some of the commands require elevation, so I need to issue commands such as ssh user@host "sudo apt-get install blah"
.
The problem is, sudo
refuses point-blank to accept a password via the terminal unless it finds a real terminal on its stdin. Is there some way I can fool sudo
into allowing this?