Answer the question
In order to leave comments, you need to log in
Why does sudo ask for the root password?
Good afternoon,
Almost freshly installed OS (CentOS 8.3), let's say postfix is on it.
I created a test user, I want to allow it to restart postfix, in the /etc/sudoers.d folder I create a test file, with the content:
test ALL = (root) /usr/bin/systemctl restart postfix.service I
save, when I try to execute the command,
I get a message in logs:
Mar 29 19:37:48 centos8 polkitd[815]: Registered Authentication Agent for unix-process:85080:1301031 (system bus name :1.583 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Mar 29 19:37:51 centos8 unix_chkpwd[85112]: password check failed for user (root)
Mar 29 19:37:51 centos8 polkit-agent-helper-1[85092]: pam_unix(polkit-1:auth): authentication failure; logname= uid=1001 euid=0 tty= ruser=root rhost= user=root
Mar 29 19:37:53 centos8 polkitd[815]: Operator of unix-process:85080:1301031 FAILED to authenticate to gain authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.584 [/usr/bin/systemctl restart postfix.service] (owned by unix-user:test)
Mar 29 19:37:53 centos8 polkitd[815]: Unregistered Authentication Agent for unix-process:85080:1301031 (system bus name :1.583, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Mar 29 19:37:56 centos8 polkitd[815]: Registered Authentication Agent for unix-process:85137:1301784 (system bus name :1.590 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Mar 29 19:37:59 centos8 polkitd[815]: Operator of unix-process:85137:1301784 successfully authenticated as unix-user:root to gain ONE-SHOT authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.591 [/usr/bin/systemctl restart postfix.service] (owned by unix-user:test)
Mar 29 19:38:00 centos8 polkitd[815]: Unregistered Authentication Agent for unix-process:85137:1301784 (system bus name :1.590, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question