I'm using a git post-update hook to run a command via sudo, and I get the error: sudo: sorry, you must have a tty to run sudo
. I believe I need to modify /etc/sudoers
but I don't know how to do this. Any help would be appreciated!
Asked
Active
Viewed 1,502 times
2

Justin Meltzer
- 711
- 1
- 9
- 19
1 Answers
4
If you have the line
Defaults requiretty
in your sudoers
file, comment it out.

MadHatter
- 79,770
- 20
- 184
- 232
-
Thanks! What exactly does this do? Could it have any unintended consequences? – Justin Meltzer Jul 13 '12 at 15:38
-
2If set, sudo will only run when the user is logged in to a real tty. When this flag is set, sudo can only be run from a login session and not via other means such as cron(8) or cgi-bin scripts. This flag is off by default. http://www.gratisoft.us/sudo/sudoers.man.html – Aaron Copley Jul 13 '12 at 15:41