1

I am normal user with sudo privileges. I just installed apache2 and when tried to restart the service, it asked for the password of another sudo user in the system.

I can restart like sudo /etc/init.d/apache2 restart. But why it is behaving like this?

Details::

enter image description here

givinv@87-109:~$ 
givinv@87-109:~$ uname -a
Linux 87-109 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
givinv@87-109:~$ 
givinv@87-109:~$ 
givinv@87-109:~$ apachectl -v
Server version: Apache/2.4.18 (Ubuntu)
Server built:   2016-07-14T12:32:26
givinv@87-109:~$ 
givinv@87-109:~$ sudo cat /etc/sudoers | grep 'ashu\|givin'
ashutosh ALL=(ALL:ALL) ALL
givinv ALL=(ALL:ALL) ALL
givinv  ALL=(ALL) NOPASSWD:ALL
givinv@87-109:~$ 
givinv@87-109:~$ 

Is it related to apache2 or sudo user ? Please let me know if more details needed.

prado
  • 275
  • When you run sudo /etc/init.d/apache2 restart which user's password is required? – SuB Nov 26 '16 at 08:45
  • It doesn't require password as I mentioned givinv ALL=(ALL) NOPASSWD:ALL in sudoers file. I just removed that line from sudoers file and tried, it was asking for the same(givinv) user password. – prado Nov 26 '16 at 09:01
  • Is your apache run under user ashutosh? – SuB Nov 26 '16 at 09:16
  • No. I installed it with the same user.

    givinv@87-109:~$ sudo find /etc/ -name apache2 | xargs ls -l | grep ashu | wc -l 0 givinv@87-109:~$

    – prado Nov 26 '16 at 09:20
  • The process run as www-data user. – prado Nov 26 '16 at 09:24
  • Thanks, that was it ! sudo group was added in file inside etc/polkit-1/localauthority.conf.d/. My user was not added in that group. – prado Nov 27 '16 at 01:46

0 Answers0