I made a script to set/unset the proxy setting for when I switch between work and home. The script works perfectly and now I wanna run it every time automatically when I login so I put it in my .profile (like : source ~/bin/proxyscript.sh).
This works when I was using Ubuntu Gnome and during login I get a terminal and it asked for the sudo password. Since version 16.10 I installed a clean version of Ubuntu Unity and now I get the error message "sudo: no tty present and no askpass program specified" when I login.
In the script I do something like :
sudo service cntlm stop
sudo sed ..... /etc/cntlm.conf
sudo service. cntlm start
I already looked at the /etc/sudoers file and added the following without a good result:
Defaults !/usr/bin/sed !requiretty
Defaults !/usr/sbin/service !requiretty
root ALL=(ALL:ALL) ALL
jeroen ALL=NOPASSWD: /bin/sed, /usr/sbin/service
I don't know what I now can try to fix this problem. Anyone any idea ?
Thanks.