Aug
17

Sudo error: Sorry, you must have a tty to run sudo

From time to time, we perform remote actions on the servers that we manage, including, but not limited to, automated file transfers. For this, rsync is used to simplify the operation and until recently, I encountered this weird error:

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

But where on this bloody earth did that error came from? All was going well until a new server was added to the pool of money-making machines and powerful enough to throw me off guard. This can’t be happening! I own these machines, I built them from scratch and configured them exactly the way I built the other servers! I could not be any wrong-er, the server must be leading an uprising against me!

Okay, that was an exaggeration (or paranoia). But it is true that the server has the same configuration as the rest. Except for one little line of default configuration:

Defaults requiretty

Comment out this line in visudo (must be root to edit) and everything should checkout.

Related Posts

Post comment

CommentLuv Enabled