In the /etc/sudoers file check for a line Defaults requiretty I've always removed it, but you may want to check with whoever manages your company security policies.