I'm trying to push a git commit from my laptop to my server but keep getting the following error message:

remote: sudo: no tty present and no askpass program specified 
To ssh://[email protected]/~/site_hub

I have the following in my sudoers:

Defaults:git !requiretty
git ALL=(apache) NOPASSWD: /usr/bin/git

Not sure why I'm getting that error message. I've Googled around but I'm not finding the solution.

1 Answer 1


ssh does not always open a (pseudo) tty. This may be the case here. tty allocation can be enforced though: ssh -t or even ssh -tt. If you cannot pass command line arguments then you can do the same via the config file: RequestTTY yes or RequestTTY force, see man ssh_config.

  • The ssh is through a Win Vista laptop git pgm (msysGit) to a CentOS server. Guess I'll have to see if I can make those changes on the Win end.
    – Ian
    Apr 13, 2013 at 5:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .